Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
  • Games
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
  • JavaScript
    • Getting Started
    • How-Tos
    • Reference
  • PHP
  • More SDKs
  • Core Methods
    • FB.api
    • FB.init
    • FB.ui
  • Auth Methods
    • FB.getAuthResponse
    • FB.getLoginStatus
    • FB.login
    • FB.logout
  • Event Handling
    • FB.Event.subscribe
    • FB.Event.unsubscribe
  • XFBML
    • FB.XFBML.parse
  • Canvas Methods
    • FB.Canvas.Prefetcher.addStaticResource
    • FB.Canvas.Prefetcher.setCollectionMode
    • FB.Canvas.hideFlashElement
    • FB.Canvas.scrollTo
    • FB.Canvas.setAutoGrow
    • FB.Canvas.setDoneLoading
    • FB.Canvas.setSize
    • FB.Canvas.setUrlHandler
    • FB.Canvas.showFlashElement
    • FB.Canvas.startTimer
    • FB.Canvas.stopTimer

FB.init

JavaScript › Reference › FB.init

Overview

After loading the JavaScript SDK, call FB.init to initialize the SDK with your app ID. This will let you make calls against the Facebook API.

Note: If you are using an app ID, all methods must be called after FB.init.

Parameters

NameTypeDescription
optionsObject

See Options below

Options

Property Type Description Argument Default
appId String Your application ID. Optional null
cookie Boolean true to enable cookie support. Optional false
logging Boolean false to disable logging. Optional true
status Boolean true to fetch fresh status. Optional true
xfbml Boolean true to parse XFBML tags. Optional false
channelUrl String Specifies the URL of a custom URL channel file. This file must contain a single script element pointing to the JavaScript SDK URL. Optional null
authResponse Object Manually set the object retrievable from getAuthResponse. Optional true
frictionlessRequests boolean see Frictionless Requests Optional false
hideFlashCallback Object see Custom Flash Hide Callback Optional null
Updated over a year ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy