@jti-extensions/client
TypeScript icon, indicating that this package has built-in type declarations

5.6.4 • Public • Published

SDK

Kind: global class

jtiExtension.init(options) ⇒ Response.Init

Initializes the SDK with the provided options. This should be called before or during startup of the extension in order to retrieve necessary information about the user, language, and more.

Kind: instance method of SDK

Param Type Description
options Options.Init

The initialization options.

jtiExtension.setResult(options) ⇒ Response.Result

To be called after each session. Grants reward points and writes the achieved score to the database.

Kind: instance method of SDK

Param Type Description
options Options.Result

The result options.

jtiExtension.getRanking(options) ⇒ Response.Ranking

Retrieve the ranking for the provided extensionName and the attached options.

Kind: instance method of SDK

Param Type Description
options Options.Ranking

The ranking options.

jtiExtension.setResultAndGetRanking(resultOptions, rankingOptions) ⇒ Response.ResultAndRanking

Helper to set result and fetch ranking in one simple step.

Kind: instance method of SDK

Param Type Description
resultOptions Options.Result

The result options.

rankingOptions Options.Ranking

The ranking options.

jtiExtension.quit() ⇒ void

Redirects to the specified quitUrl.

Kind: instance method of SDK

jtiExtension.getStats(options) ⇒ Response.Stats

Gets stats about the game.

Kind: instance method of SDK

Param Type Description
options Options.Stats

The stats options.

JtiExtension : SDK

Singleton instance of the SDK.

This instance is created and exported as JtiExtension. It ensures that only one instance of the SDK class exists throughout the application.

Kind: global constant
Singleton:


© 2024 Sensory-Minds GmbH

Readme

Keywords

none

Package Sidebar

Install

npm i @jti-extensions/client

Weekly Downloads

13

Version

5.6.4

License

UNLICENSED

Unpacked Size

32.6 kB

Total Files

35

Last publish

Collaborators

  • sashthecash
  • kpotschien
  • matefm
  • joego