Module: session
Table of contents
Functions
Functions
getEntryPointAsync
▸ getEntryPointAsync(): Promise
<string
>
Gets the entry point of where the game started from.
Example
Returns
Promise
<string
>
Details about where the game started from.
Throws
NOT_SUPPORTED
RETHROW_FROM_PLATFORM
getEntryPointData
▸ getEntryPointData(): Record
<string
, unknown
>
Gets the data bound to the entry point.
Example
Returns
Record
<string
, unknown
>
Data about the entry point or an empty object if none exists.
getLocale
▸ getLocale(): string
Gets the locale the player is using.
Example
Returns
string
Locale in BCP47 format.
getTrafficSource
▸ getTrafficSource(): TrafficSource
Gets the traffic source info for the game.
Example
let source = Wortal.session.getTrafficSource();
console.log(source['r_entrypoint']);
console.log(source['utm_source']);
Returns
TrafficSource
URL parameters attached to the game.
setSessionData
▸ setSessionData(data
): void
Sets the data for this session. This is not persistent and is only used to populate webhook events.
Example
Parameters
Name | Type | Description |
---|---|---|
data |
Record <string , unknown > |
Data to set. |
Returns
void