@power-gaming/integration-api-client
v0.1.0
Published
The power-gaming integration api gateway.
Readme
Power Gaming Integration API Client
The Power Gaming Integration API Client is your gateway for third-party integrations with the Power Gaming Platform.
Getting Started
1. Installation
npm install @powergaming/integration-api-client2. Configuration
Configure the PowerGaming client with the required options.
import { PowerGamingClient, InMemorySessionManager, Environment, PowerGamingClientOptions } from '@powergaming/integration-api-client';
const client: PowerGamingClient = new PowerGamingClient({
clientId: "client_id",
clientSecret: "client_secret",
customer: "power-gaming",
environment: "staging",
sessionManager: new InMemorySessionManager(),
});PowerGamingClientOptions:
| Option | Type | Description |
|----------------|------------------|-----------------------------------------------------|
| clientId | string | Your unique API client ID (supplied by PowerGaming) |
| clientSecret | string | Your API client secret (supplied by PowerGaming) |
| customer | string | Your customer identifier |
| environment | Environment | API environment (e.g., 'production', 'staging') |
| sessionManager | SessionManager | Session manager instance (InMemorySessionManager) |
Usage
Launching the Promotion Lobby
To launch a promotion lobby for a player, request a scoped access token. This token includes casino and player metadata and is valid only for the target casino.
import { PowerGamingLobbyRequest, PowerGamingLobbyResponse } from '@powergaming/integration-api-client';
const getLobbyDetails = async (
powerGamingLobbyRequest: PowerGamingLobbyRequest,
): Promise<PowerGamingLobbyResponse> => {
return client.launchLobby(powerGamingLobbyRequest);
};PowerGamingLobbyRequest:
| Field | Type | Required | Description |
|----------|----------|----------|------------------------------|
| playerId | string | Yes | Unique identifier for player |
| gameId | string | Yes | ID of the game to launch |
| nickname | string | no | The nickname of the player |
PowerGamingLobbyResponse:
| Field | Type | Description |
|-------------|----------|----------------------------------------|
| accessToken | string | Scoped token for lobby/player session |
| lobbyUrl | string | URL for player to access the promotion |
The PowerGamingLobbyResponse is supplied to the promotion-widget via the casino object
Support
Need help reach out to the PowerGaming team or open an issue.
