Integrates the Poki JavaScript SDK (PokiSDK) into JavaScript browser games. Initializes PokiSDK, configures interstitial and rewarded ad breaks (commercialBreak, rewardedBreak), manages gameplay lifecycle events (gameplayStart, gameplayStop), and sets up loading progress tracking (gameLoadingFinished). Use when the user mentions Poki, PokiSDK, web game monetization, game portal integration, ad breaks in browser games, or distributing an HTML5 game on the Poki platform.
74
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
PokiSDK.init() and resolve gameLoadingFinished when the game is ready.gameplayStart / gameplayStop around every play session.commercialBreak at natural pause points; add rewardedBreak where the player can opt in.https://inspector.poki.io, load your game URL, and trigger each ad break to confirm the flow.Add the official Poki SDK script to your page:
<script src='https://game-cdn.poki.com/scripts/v2/poki-sdk.js'></script>Or inject it dynamically:
function loadPokiSdk() {
return new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = 'https://game-cdn.poki.com/scripts/v2/poki-sdk.js'
script.onload = resolve
script.onerror = reject
document.head.appendChild(script)
})
}loadPokiSdk()
.then(() => window.PokiSDK.init())
.then(() => {
// SDK is ready
window.PokiSDK.gameLoadingFinished()
})
.catch(() => {
// SDK init failed - continue without Poki integration
window.PokiSDK && window.PokiSDK.gameLoadingFinished()
})Call gameLoadingFinished when the game is ready for the player. If your loader has discrete phases, bracket them with gameLoadingStart and gameLoadingFinished.
Use the isOpened flag to detect whether an ad was actually delivered — the callback is not invoked when no ad is shown.
function showInterstitial() {
let isOpened = false
window.PokiSDK.commercialBreak(() => {
isOpened = true
// Pause game, mute audio
})
.then(() => {
if (isOpened) {
// Resume game, unmute audio
} else {
// Ad was not shown
}
})
.catch(() => {
// Ad request failed
})
}rewardedBreak resolves with a boolean — grant the reward only when both isOpened is true and the resolved value is truthy.
function showRewarded() {
let isOpened = false
window.PokiSDK.rewardedBreak(() => {
isOpened = true
// Pause game, mute audio
})
.then((success) => {
if (isOpened) {
if (success) {
// Grant reward to the player
}
// Resume game, unmute audio
} else {
// Ad was not shown
}
})
.catch(() => {
// Ad request failed
})
}Call gameplayStart when the player gains control (level start, level resume) and gameplayStop when control is taken away (level paused, completed, failed, or returning to a menu). Pair every gameplayStart with a matching gameplayStop.
function onLevelStart() {
window.PokiSDK.gameplayStart()
}
function onLevelEnd() {
window.PokiSDK.gameplayStop()
}https://inspector.poki.io and load your game URL to get a developer session.init resolves and gameLoadingFinished is acknowledged.commercialBreak and rewardedBreak via the Inspector UI to simulate ad delivery and verify pause/resume logic fires correctly.gameplayStart and gameplayStop events appear in the Inspector timeline at the correct moments.Notes on omitted features: this skill does not cover server time, ad-block detection, happyTime, or gameInteractive; keep the implementation focused on the Poki SDK features listed above.
1adb800
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.