Getting Started

Add login and cloud saves to your game in 2 steps.

1

Create a Game & Get API Keys

  1. Sign up at indie.fun/signup
  2. Go to Developer and click “New Game”
  3. Open your game and click “Generate API Keys”
  4. Copy your App ID and App Secret
2

Add to Your Game

Browser (game page)

<script src="https://www.indie.fun/js/indie.js"></script>
<script>
  new Indie({ appId: 'your-app-id' });
</script>

A login widget appears automatically. Players log in, and the event is sent to your game server.

Guest analytics consent (optional)

Anonymous players are counted toward daily active users and retention. By default (consent: 'auto') the SDK shows a small bar to first-time visitors so players are always told — in the EU/UK it asks permission and counts nobody until they Allow; elsewhere it's a notice with a Decline option that dismisses itself. Either way it appears once and is remembered. To use your own consent UI instead, set consent: 'manual' and call the SDK when the player chooses:

const indie = new Indie({ appId: 'your-app-id', consent: 'manual' });

// from your own banner:
indie.optIn();   // allow anonymous analytics
indie.optOut();  // decline (also stops tracking)
indie.getConsent(); // 'granted' | 'denied' | 'unknown'

Do Not Track / Global Privacy Control are always honored. Logged-in players are counted regardless. Use consent: 'off' only if your site handles consent itself.

Server (game server)

npm install indie-sdk
const { Indie } = require('indie-sdk/server');

const indie = new Indie({
  appId: 'your-app-id',
  appSecret: 'your-app-secret',
});

indie.on('playerJoin', (player) => {
  console.log(player.id);          // unique player ID
  console.log(player.name);        // display name
  console.log(player.data);        // saved game data (guaranteed loaded)
  console.log(player.permissions); // { chat: true, vip: false }
});

// Save player data anytime
indie.savePlayerData(player.id, { highScore: 9001 });

That's it. See the API Reference for details.