npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ninebytes-fb-login

v0.0.12

Published

Facebook Login API Implemented in an Angular Service

Downloads

35

Readme

Facebook Login API in an Angular Service

An implementation of the Facebook Login API using an Angular service.

Getting the module

From github git clone [email protected]:yakovkhalinsky/ninebytes-fb-login.git ninebytes-fb-login

From bower bower install angular-fb-login

From npm npm install ninebytes-fb-login

Installation instructions

  1. Do an npm install to setup the example node.js app
  2. Copy src/fb.config.angular.js.example to src/fb.config.angular.js
  3. Edit src/fb.config.angular.js adding your appId in APP_ID
  4. Edit app.js adding you Facebook App Token in APP_TOKEN
  5. Edit src/fb.config.angular.js adding your app's permissions in PERMISSIONS
  6. Edit src/fb.config.angular.js setting DEBUG to true will trigger console.log() for testing
  7. Run grunt in the base directory to create dist directory with files you can use in your project.

NOTE: Step 6 also creates a minified version of the final distribution file.

NOTE: src/fb.config.angular.js is git ignore to avoid committing credentials to the repo

Promise chaining from Init, Login and Logout

The init(), login() and logout() functions of the service return a promise.

You can use this to change other function calls once these promises resolve.

For example:

fb.init(ctrlScope).then(function() {
    // do something in here
});

fb.login().then(function() {
    // do something in here
});


fb.logout().then(function() {
    // do something in here
});

Note it is important to check the users authentication status in case either action was unsuccessful.

To run example

  1. Run npm install
  2. Run node app.js
  3. Visit localhost:3000/index.html in your browser

Server-side user verification

There is an example route handler in app.js that you can use at localhost:3000/:authToken/:userId in your browser once the user is logged in.

Another example implementation can be found in example/fb.js.

If you used npm install ninebytes-fb-login get this module then use like so:

The example route uses the ninebytes-node-fb-login module.

Changelog

See CHANGELOG.md

TODOs

  1. Add tests