Skip to main content
Most games never need these modules: saves, achievements, purchases, ads and analytics have their own. Use them only when no module covers what you need.

Backend

Backend sends a request to SusaPlay’s API with the player’s token attached, and returns an HttpResponse. The platform decides what the player may do on each route.
  • The path must be relative and start with /. A full URL is refused, so the player’s token is never sent to another host.
  • Post sends {} when the body is null.
HttpResponse:
In the Editor Simulator, a route the simulator does not answer returns 501 SIMULATOR_UNSUPPORTED_ROUTE. Test such calls in a build preview.

Api

Api reaches the API of a SusaPlay partner when your game runs inside that partner’s site. The SusaPlay page forwards the request to the partner’s server, using the base URL, the allowed paths and the credentials SusaPlay holds for that partner. Your game never sees the partner’s credentials.
Methods: Get(endpoint), Get(endpoint, parameters), Post(endpoint, json) and Request(method, endpoint, json). Only GET and POST are supported, and the endpoint must be a relative path. ApiResult: The partner’s base URL and allowed paths are set by SusaPlay when the partnership is configured.