Client side (Javascript) reference

The FB object

This is the object generated by the Facebook Javascript SDK. It’s available once the SDK is loaded and provides all the methods to interact with Facebook. Check out the Facebook documentation at http://developers.facebook.com/docs/reference/javascript/.

The fb object

This is a helper object generated by our facebook app. If the user is logged in it stores some useful informations such as user info and permissions. Feel free to add your own attributes. By default it provides the following attributes if the user is logged in:

  • auth
    • accessToken: The user access token.
    • expiresIn: Seconds until the access token expires.
    • signedRequest: The signed request. SHA-1 encrypted.
    • userID: The current user’s Facebook ID.
  • get_perms(callback_fn) This calls the callback function with a list containing the user’s permissions. The reason to use this instead of FB.api is that the permissions are cached.
  • status The status of the User. One of connected, notConnected or unknown.