Integrate with the Lifegraph physical development platform.
Use this node package to convert physical IDs to Facebook IDs and handle authentication for users.
You can register your Facebook applications with Lifegraph Connect (http://lifegraphconnect.com).
First, you'll need to create a Facebook application. If you don't yet have one, go to the Facebook App Dashboard, verify your account, add the Developer app, then click the 'Create New App' button. More information on creating an App can be found here on the Facebook tutorial. Open Graph applications are great for posting data from the real world, but if you just want to pull data, a regular Facebook App is fine (that is, you only need to complete step 1 of the Facebook tutorial).
Next, you'll need to add
lifegraphconnect.com as an app domain. On the summary page, under "Select how your app integrates with Facebook", add
http://lifegraphconnect.com. Then add
lifegraphconnect.com to your list of App Domains (in addition to any other servers you have).
Now we'll register your app by going to Lifegraph Connect (http://lifegraphconnect.com).
Now just install the package.
npm install lifegraph
Inside your node server, configure the lifegraph module and then you can connect.
// Import the modulevar lifegraph = ;// Configure lifegraph for your app// get these from for your applifegraph;
You can convert a physical token into a user token with Facebook access tokens using Lifegraph.
The following are the possible errors you can receive:
On success, the returned object will be a JSON object:
"id": "...""tokens":"oauthAccessToken": "..."
If you wanted to restore the user tokens, you can use a Facebook module for Node. For example, we can restore the tokens easily using
var rem = ;var fb = rem;lifegraph;
You can read serial information from an Arduino using node-serialport. If you want to detect which port to read from, using
lifegraph.serialpaths() (returns an array of all Arduino paths):
var SerialPort = SerialPortvar port = lifegraphbaudrate: 9600;port;
If a physical device has never been synced to a virtual ID before, you'll need to do it on Lifegraph Connect. Click the button to connect to that app. Then, with your server running so that it will send physical IDs to the Lifegraph server, read your RFID device. The Lifegraph Connect webpage should prompt the user to claim the ID. It's that simple.