Edit in JSFiddle

// declare the 'SpilData' object and the app ID property
var SpilData = {
    id: '576742227280291016' // You receive this value from Spil Games
};

// Load the HTML5 API
GameAPI.loadAPI (function (apiInstance) {
    if (apiInstance.Game.isSiteLock())
    {
        //game should not run and lock in the current context
    }
}, SpilData);