How do you know what's passed into the callbacks in Facebook's Javascript API?

This is a general question on how to read Facebook’s Javascript API documentation. How can I get a complete description on the objects that are passed into my callback functions? Take for example FB.Login’s sparse documentation:

Name  |  Type      | Description
-------------------------------------------
cb    |  Function  | The callback function.

It does not state what is passed into this callback. I’ve been using Firebug to inspect the object that is passed back and making guesses on what each property means. My reverse engineering, along with reading of sample code, is not an efficient way to program. I would like to know where I can find the complete Facebook documentation.

  • How do I use an FB.api(JS SDK) response outside of the callback function?
  • Using the Facebook JS SDK in a Module (webpack)
  • og:image ignored
  • Fb Like button + Permission denied for <http://www.facebook.com> to get property Proxy.InstallTrigger
  • Facebook Sharer - Title and summary Customization
  • Facebook login API for javascript not working
  • getting error while posting on facebook using javascript sdk
  • You must initialize FacebookUtils before calling logIn
  • Lightbox facebook iframe, video embed
  • FB.Canvas.getPageInfo scrollTop broken on page tabs
  • How to test facebook “like” button?
  • FB.getLoginStatus is not called when doing a page refresh (Facebook Javascript SDK)
  • One Solution collect form web for “How do you know what's passed into the callbacks in Facebook's Javascript API?”

    For the FB.Login() call you asked about, there is this code example:

    FB.login(function(response) {
       if (response.authResponse) {
         console.log('Welcome!  Fetching your information.... ');
         FB.api('/me', function(response) {
           console.log('Good to see you, ' + response.name + '.');
         });
       } else {
         console.log('User cancelled login or did not fully authorize.');
       }
     });
    

    That shows that the callback takes one argument and it’s the login response. The login response appears to be discussed here in the doc for FB.getLoginStatus().

    {
        status: 'connected',
        authResponse: {
            accessToken: '...',
            expiresIn:'...',
            signedRequest:'...',
            userID:'...'
        }
    }
    

    I would agree that the FB doc doesn’t make it clear where to find things like the response object format.

    In answer to your general question, it appears you look for a piece of sample code to see how the callback function is declared and then poke around in related methods until you find the doc for the arguments themselves.