Complete reference for Browser and Server SDKs.
<script src="https://www.indie.fun/js/indie.js"></script>
new Indie({ appId })Create client — auto-mounts login widget and tracks sessionsnew Indie({ appId, consent })consent: 'auto' (default) shows an EU/UK guest-analytics banner; 'manual' lets you drive consent yourself; 'off' disables gating.indie.optIn()Allow anonymous analytics for this visitor and start tracking.indie.optOut()Decline/withdraw consent. Stops guest tracking and drops the device id.indie.getConsent()Returns 'granted' | 'denied' | 'unknown'. Do-Not-Track / GPC report 'denied'.Logged-in players are always counted. The widget handles login automatically and notifies your game server via WebSocket when a player joins.
npm install indie-sdk
const { Indie } = require('indie-sdk/server')
new Indie({ appId, appSecret })Connect to Indie and start receiving player eventsindie.on('playerJoin', (player) => {})Called when a player logs in. player has id, name, data, highScore, permissions.indie.getPlayerData(playerId)Load all saved data for a player. Returns Promise<object>.indie.savePlayerData(playerId, data)Replace all data for a player. Returns Promise<void>.indie.updatePlayerData(playerId, data)Merge fields into existing data (partial update). Returns Promise<void>.{
id: string
name: string
data: Record<string, unknown>
highScore: number
permissions: Record<string, boolean>
}