Livefyre's official library for common server-side tasks necessary for getting Livefyre apps (comments, reviews, etc.) working on your website.
Run this line:
$ npm install livefyre
Instantiating a network object:
var network = livefyre.getNetwork('networkName', 'networkKey');
Creating a Livefyre token:
network.buildLivefyreToken();
Creating a user auth token:
network.buildUserAuthToken('userId', 'displayName', expires);
To validate a Livefyre token:
network.validateLivefyreToken('lfToken');
To send Livefyre a user sync url and then have Livefyre pull user data from that url: callbacks are optional. defaults will console.log
network.setUserSyncUrl('urlTemplate', callback);
network.syncUser('userId', callback);
Instantiating a site object:
var site = network.getSite('siteId', 'siteKey');
Building a collection meta token: The 'tags' and 'type' arguments are optional.
site.buildCollectionMetaToken('title', 'articleId', 'url', 'tags', 'type');
Building a checksum: The 'tags' argument is optional.
site.buildChecksum('title', url', 'tags');
To retrieve content collection data:
site.getCollectionContent('articleId', callback);
To get a content collection's id: callback is optional. default will console.log
site.getCollectionId('articleId', callback);
Located here.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Note: any feature update on any of Livefyre's libraries will need to be reflected on all language libraries. We will try and accommodate when we find a request useful, but please be aware of the time it may take.
MIT