node package manager


A node.js library for getsatsfaction fastpass


A node.js library for getsatisfaction fastpass (single sign-on)

This serves as a drop-in replacement for the existing getsatisfaction fastpass libraries, and implements the same method signatures (with some defaulting for ease of use) as the ruby library. Documentation for existing fastpass libraries can be found on the getsatisfaction help site.

Add the dependency:

npm install --save fastpass

Require it:

var FastPass = require('fastpass')

Instantiate it:

var fastPass = new FastPass({
 // optional, defaults to ""
 domain : "",
 // required, your consumer key
 consumer_key : "xi2vaxgpp06m",
 // required, your consumer secret
 consumer_secret : "ly68der0hk8idfr5c73ozyq56jpwstd1",
 // optional at instantiation - email of the user
 email : "",
 // optional at instantiation - Name of the user
 name : "Scott",
 // optional at instantiation - unique ID of user (must stay the same for the lifetime the user in your system)
 unique_identifier : "nullstyle",
 // optional boolean, defaults to false
 is_secure : false,
 // optional object, any private fields you like. defaults to {}.
 private_fields : {}


fastPass.script({ email : "", name : "Scott", unique_identifier : "nullstyle" }, function(err,script){ var outputScript = script })

or if you passed name, unique_identifier, and email at instantiation:

  var outputScript = script

Now replace all links to getSatisfaction with calls to GSFN.goto_gsfn()

// for instance, in jQuery
$('body').on('click','a[href=""]',function(){ GSFN.goto_gsfn(); return false; })

Set a cookie named "fastpass" to the URL generated by the FastPass library. Note: This is only available if your company is using the CNAME feature.

// inside of an express route or whatever:
  cookies["fastpass"] = url

Include the generated URL in the param named "fastpass" in all links to Get Satisfaction.

// in some template context
  var linkUrl = "<a href="" + url + ">Our Support Community</a>"
Field         |  Required  |  Notes
Key           |    Yes     |
Secret        |    Yes     |
Email         |    Yes     |
Name          |    Yes     |
Unique Id     |    Yes     | Must remain unchanged for the lifetime of the user's account in your system.
Is Secure     |    No      | (defaults to false)
Private Fields|    No      | Key/value pairs to send along with the user to Get Satisfaction.