To diagnose the HTTP errors received from the platform server, it's recommended to subscribe to "readyStateChange" event before init() is triggered, and console.log output the received readyStateChange event to diagnose the error received.

 

skylink.on("readyStateChange", function (state, error, room) {
   console.log(state, error, room);
});

skylink.init("my_api_key");

 

More information on the readyStateChange error payload can be found here: http://cdn.temasys.com.sg/skylink/skylinkjs/0.6.x/doc/classes/Skylink.html#event_readyStateChange


You can also to the list of error cases received in http://cdn.temasys.com.sg/skylink/skylinkjs/0.6.x/doc/files/source_room-init.js.html#l30.


API_INVALID

Provided Application Key is not an actual valid Application Key available in the database.


API_DOMAIN_NOT_MATCH

Domain does not match the Application Key provided. Raise a ticket with support for help.


API_CORS_DOMAIN_NOT_MATCH

CORS domain provided in the Application Key does not match the URL accessing the SDK. Please register the correct accessing CORS URL.


API_CREDENTIALS_INVALID

Provided credentials for Application Key is invalid. Please check if the credentials format is correct as specified here: http://cdn.temasys.com.sg/skylink/skylinkjs/0.6.x/doc/classes/Skylink.html#method_init


API_CREDENTIALS_NOT_MATCH

Provided credentials does not match with expected credentials to be received. Please check if the credentials are generated correctly in http://cdn.temasys.com.sg/skylink/skylinkjs/0.6.x/doc/classes/Skylink.html#method_init.


API_INVALID_PARENT_KEY

This case usually happens for using Alias Application Keys which parent Application Key is deleted. Please use another Application Key for this case.

If this error is thrown for a parent Application Key, please raise a ticket with support for further assistance.