Skip to content

Philmod/livefyre-nodejs-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Livefyre NodeJS Utility Classes

NPM version

Livefyre's official library for common server-side tasks necessary for getting Livefyre apps (comments, reviews, etc.) working on your website.

Installation

Run this line:

$ npm install livefyre

Usage

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);

Documentation

Located here.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. 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.

License

MIT

About

Utilities and helpful things for NodeJS users

Resources

License

Stars

Watchers

Forks

Packages

No packages published