Local development
A game remains a normal web application locally. Platform identity, game services and hosted backends are supplied only by the trusted Inkwell player frame; there is no local credential that impersonates a player and no official platform emulator.
Keep game rules independent
Put platform calls behind a small adapter. Use a local adapter for deterministic names, scores and saves, then select the Inkwell adapter in a hosted build. Do not fake the parent-frame protocol or put creator tokens in browser code.
// platform.ts
export const platform = location.hostname === 'localhost'
? {
player: async () => ({ displayName: 'Local player', isGuest: true }),
ready: () => console.info('ready'),
track: (name, data) => console.info(name, data),
}
: {
player: () => Inkwell.player.get(),
ready: () => Inkwell.ready(),
track: (name, data) => Inkwell.analytics.track(name, data),
}Test the real integration in a draft
npm run build
inkwell deploy
# Open the private preview URL printed by the command.Draft previews provide real account identity, origin checks, loading, achievements, leaderboards, analytics and backend startup. Add named testers when other accounts need preview access. Never use a public release as the first integration test.
Local saves and service workers
LocalStorage and IndexedDB are suitable for local iteration but are not account saves. Hosted build origins are immutable and differ between releases. Store durable account progress through the game backend or platform stats. If developing a service worker, register it with a relative URL and test a production build; do not make it navigate or cache Inkwell host pages.