title: How to get Facebook access token from Graph API Javascript SDK?
body: <p>I'm trying to alert the <code>access_token</code> with a simple function but I'm getting <code>undefined</code> I'm following their syntax but maybe I'm doing something wrong?</p>
  
  <p><strong>javascript</strong></p>
  
  <pre><code>   function logMe() {  
      FB.login(function(){
        FB.api('/me/accounts', {fields: 'access_token'}, function(response) {
        var accessToken = response.data.access_token;
        alert(accessToken);
          } );
      }, {scope: 'manage_pages'});
      }
  </code></pre>