Method signature

Method is used for OK JS SDK initialization in mobile and external apps.

OKSDK.init(config, onSuccess, onError)

Where:

  • config - app settings object containing it’s ID and public key;
var config = {
    app_id: 0,
    app_key: ''    
}
  • onSuccess - callback function that will be invoked on success;
  • onError - callback function that will be invoked on error.

Example usage

/*
* OK SDK initialization
*/
var config = {
    app_id: 0, // app ID 
    app_key: '' // app public key
};

OKSDK.init(
    config, 
    function () {
        //on success
    }, 
    function (error) {
        //on error
    }
);