JavaScript SDK

JavaScript SDK is SDK of built-in applications that are iframes, the content of which is located on the developer’s server.

SDK contains 4 method groups:

Connecting a library:

<script type="text/javascript" src="//" defer="defer"></script>

When using js + flash in a flash application, the “wmode=opaque” parameter must be set.

After every transition inside an iframe it is necessary to perform an initialization again with the FAPI.init method, as well as pass the following parameters:

  • api_server
  • apiconnection
  • web_server
  • application_key
  • session_key
  • session_secret_key


Methods from the FAPI.UI group don’t require the callback function to be passed. After the method is executed, a global function will be called, and the developer must realize it. The function must have the signature:

function API_callback(method, result, data);


  • method - the name of the method called
  • result - the result of the execution (“ok” if successful, “cancel” if the user canceled the action)
  • data - additional information, for example, for showInvite() – a list of IDs of invited friends, separated by commas, in the string format.