View on GitHub


The Facebook App Starter Kit

Download this project as a .zip file Download this project as a tar.gz file

Created by Matthew Wilber:

FASK provides a ready made starting point for building facebook apps using the facebook javascript api. It's built on the HTML5 Boilerplate ( and provides javascript functions for the most commonly used facebook features.

View the stock FASK install on facebook:

FASK is free to use in your projects as you see fit. If you use this project, please share on facebook.

Getting Started

  1. Set up an app on the facebook developer site:
  2. Open the file js/config.js:

    var FBconfig = {
            id: 'XXXXXXXXXXXXX',                                // id of facebook application
            perms: 'publish_stream, user_photos, user_likes',   // extended permissions required of htis app. Leave as empty string for no extended permissions.
            site: ''            // direct url to app server
            method: 'popup',                                    // 'redirect' or 'popup'
            target: ''    // endpoint url if loginmethod is 'redirect'
            targetid: 'XXXXXXXXXXXXX',                          // facebook id of target link
            targeturl: '',    // url of target link
            gatepage: 'likegate.html',                          // like gate page
            redirect: 'index.html'                              // destination page for users who pass through like gate
  3. To get up and running all you need to do is insert your app id in the variable

  4. Adjust the other FBconfig variables as necessary for your app.

  5. Add your app specific javascript to the js/script.js file

Facebook Login and Authorization

FASK supports both popup and redirect methods of facebook authorzation. Use the redirect method only if popup blockers become an issue. Simply call the Login(); function at any point in your javascript on or after the page's OnLoad event is called. FASK will automatically determine the user's authorization status based on the permissions set in as shown above. When using the popup method, the Login() function will trigger one of two events: "AuthorizedUser" and "UnauthorizedUser". The file js/script.js has example event handlers which will set the global variable fb_auth with the user's id number and authorization token for use in graph calls. You may modify these functions or add additional event handlers for your app.

Like Gate

There are two like gate options available.