@octane-rgs/core
v1.3.1
Published
Core SDK for Octane RGS — sessions, table management, queries
Readme
@octane-rgs/core
Base SDK for Octane RGS. Provides session management, table sessions, queries, and shared types.
Most consumers should use @octane-rgs/live (live/dealer games) or @octane-rgs/instant (instant-resolution games) instead — they extend this package and include all methods listed below.
Install
npm install @octane-rgs/coreQuick Start
import { OctaneRgsClient } from "@octane-rgs/core";
const rgs = new OctaneRgsClient({
baseUrl: "https://staging.octanestudios.ai",
apiKey: "your-api-key",
});
const { sessionToken } = await rgs.launch({
externalPlayerId: "player-123",
tableSessionId: "550e8400-e29b-41d4-a716-446655440000",
tableGameCode: "baccarat",
currency: "USD",
});
const { balance } = await rgs.getBalance(sessionToken);API
Sessions
| Method | Description |
|--------|-------------|
| launch(params, apiKey?) | Create a player session |
| operatorInfo(apiKey) | Get operator details and bet config |
| getBalance(sessionToken) | Get player balance from operator wallet |
| getPlayerSession(sessionToken) | Get session details |
| redeemLaunch({ sessionToken }) | Single-use exchange of a launch URL token for the session; throws LaunchRedeemError (LAUNCH_ALREADY_REDEEMED, LAUNCH_EXPIRED) |
| markStarted(sessionToken) | Mark session as started |
| realityCheck(sessionToken) | Session duration, total wagered, net position |
Table Sessions
| Method | Description |
|--------|-------------|
| upsertTable(params) | Create or update a table session |
| endTable(tableSessionId, endedAt) | End a table session |
| getTableSession(tableSessionId) | Get table session details |
| lobbies(publicOnly?) | List active table sessions |
| activeByGame(gameCode) | Find active table by game code |
| activeByTableCode(tableCode) | Find active table by table code |
| activeByAvatar(slug) | Deprecated: use activeByTableCode |
| activeByAvatarGame(avatarName, gameName) | Find active table by avatar + game |
| updateRoomStates(params) | Batch update room states (active/dormant) |
| cleanup(params) | Find and mark stale sessions as dead |
Queries
| Method | Description |
|--------|-------------|
| roundWinners(roundId) | Get winners for a round |
| lastPayout(sessionToken) | Get last payout amount |
| betStatistics(roundId, betOptions) | Get bet distribution stats |
| playerHistory(sessionToken, limit?, offset?) | Get player bet/payout history |
| roundHistory(tableSessionId, limit?) | Get round history for a table |
| roundDetails(roundId, opts?) | Get a round with its table and each player's bets and payouts; operator keys see only their players, platform keys need opts.externalPlayerId (optionally opts.operatorCode) to get players |
Free Rounds
| Method | Description |
|--------|-------------|
| getFreeRounds(playerId, gameCode?) | Get active free round grant |
Self-Exclusion
| Method | Description |
|--------|-------------|
| excludePlayer(params) | Self-exclude a player for a duration |
| getExclusionStatus(externalPlayerId) | Check exclusion status |
Changes
- 1.3.0:
redeemLaunch({ sessionToken }),LaunchRedeemErrorandLaunchRedeemErrorCode. A launch'ssessionTokencan be redeemed once, within a window (default 10 minutes) re-armed by everylaunch;getPlayerSessionis unchanged and does not redeem. - 1.2.0 (breaking):
roundWinnersentries (newRoundWinnertype) andRoundDetailsPlayerreplaceplayerSessionIdwithplayerRef, a stable pseudonym. The session id is the player'ssessionToken, a bearer credential, so it is no longer returned by query endpoints. - 1.1.4:
RoundDetailsPlayer.currency - 1.1.2: Added
roundDetailsand theRoundDetails,RoundDetailsPlayer,RoundDetailsBet,RoundDetailsPayouttypes. - 1.1.0:
remainingBalanceis now optional onOperatorAdapterConfig.placeBetresults, and balance fields may benull(playerHistorybalanceAfter).
