Skip to content

skymen/poki_sdkV2

Repository files navigation


Poki SDK

Simple plugin for games to be hosted on the Poki Platform (https://sdk.poki.com/)

Version 2.4.2.0


See all releases

What's New in 2.4.2.0

  • Fixed: Fixed language files causing a build error

View full changelog


Author: skymen, Avix Games
Construct Addon Page
Documentation
Made using CAW

Table of Contents


Usage

To build the addon, run the following commands:

npm i
npm run build

To run the dev server, run

npm i
npm run dev

Examples Files


Properties

Property Name Description Type
Enabled Whether the SDK is enabled combo
Debug on preview Whether to enable debug mode check
Game ID Enter the ID of the game here for the beacon to work text
Do beacon Whether to send beacons to Poki check
Beacon interval Number of seconds between beacons integer
Max beacons Maximum number of beacons to send integer
Loading notification When to notify the DOM that the game has finished loading combo
Automatic suspend Automatically suspend the SDK when the game is suspended check
Suspend timeout Number of seconds to wait before suspending the SDK integer
Auto delay gameplay start Automatically delay the gameplay start to wait for the user to interact with the game check

Actions

Action Description Params
Get Token Fetch a short-lived JWT token for the current user. The token expires in 1 minute.
Login Prompt the user to log in. If the user logs in, the page will refresh. If already logged in, resolves immediately.
Interstitial Request an interstitial ad Tag (string)
Rewarded Request a rewarded ad Tag (string)
Size (combo)
Send Event Send an analytics event Category (string)
What (string)
Action (string)
Gameplay Start Notify the SDK that the gameplay has started
Gameplay Stop Notify the SDK that the gameplay has stopped
Loading End Manually notify the SDK that the game has finished loading
Get Shareable URL Generate a shareable Poki URL with custom parameters. Parameters are passed as a JSON string. Params (string)
Move Pill Reposition the Poki Pill on mobile. topPercent (0-50) sets vertical position as percentage from top, topPx is additional pixel offset (positive moves down, negative moves up) Top Percent (number)
Top Pixels (number)
Open External Link Open an external link using Poki's openExternalLink API URL (string)
Submit Score Submit a score using Poki's submitScore API Name (string)
Score (number)

Conditions

Condition Description Params
Is Logged In Check if a user is currently logged in
On Get Token Triggered when a JWT token has been successfully fetched
On Login Failed Triggered when login fails (user closed auth panel or login timed out)
On User Changed Triggered when the user state changes (after loading or after login)
Last Rewarded Success Last Rewarded Success
On Interstitial Complete Triggered when an interstitial ad is completed Tag (string)
On Rewarded Complete Triggered when a rewarded ad is completed Tag (string)
SDK Is Enabled Check if the SDK is enabled
SDK Is Loaded Check if the SDK is loaded
On Shareable URL Triggered when a shareable URL has been generated

Expressions

Expression Description Return Type Params
AvatarUrl The avatar URL of the currently logged-in user string
Token The last fetched JWT authentication token string
Username The username of the currently logged-in user string
LastAdTag Last Ad Tag string
LastRewardedSuccess Last Rewarded Success number
ShareableURL The last generated shareable URL string
URLParam Get a URL parameter value by name string Name (string)

Changelog

2.4.2.0

  • Fixed: Fixed language files causing a build error

2.4.1.0

  • Added: Added experimental support for submit score

2.4.0.0

  • Added: Support for Shareable URLS and URL Params
  • Added: Support for Rewarded ad sizes

2.3.0.3

  • Fixed: removed WIP code that I forgot to remove before pushing last update

2.3.0.2

  • Fixed: Delayed gameplay start now fires on pointer down instead of end of click

2.3.0.1

  • Added: Open External Link
  • Fixed: The default ad params are properly sent through

2.3.0.0

  • Added: Accounts support
  • Changed: Updated to new version of CAW framework
  • Fixed: Should no longer crash on older Construct versions

2.2.1.1

  • Fixed: Added translations

2.2.1.0

  • Fixed: Removed disallowed autocompleteIds from the move pill params

2.2.0.0

  • Added: Added support for moving Poki's pill

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors