Going to production
The short list of decisions and configurations that turn a sandbox embed into a production-grade integration.
Pre-launch checklist
- Created a player with all production origins (incl. wildcards if you serve subdomains).
- Picked a theme that matches your brand. Built-ins are fine — custom themes are an ID swap.
- Wired a stream for analytics so completions show up in a dashboard you'll actually open.
- Decided which features to surface: hints, leaderboards, archive, restart, share, pause.
- If you generate content yourself: created an API key with the right scopes and stored it in your secret manager.
- If you need server-side delivery confirmation: configured a webhook endpoint and verified signatures.
- Added an
externalUserIdif you want completion events tied back to your own user records.
Players
Hardcoding all options at the call site is fine for a first embed. For production, move that configuration into a
player — your Playgent.init calls stay small and your team can change theme/features without touching code.
// Before: lots of options on every page
Playgent.init({
containerId: "playgent-host",
game: "sudoku",
mode: "daily",
theme: "thm_acme_dark",
disableLeaderboards: true,
ctaText: "Read more on Acme",
ctaButtonText: "Continue",
ctaUrl: "https://acme.com/article",
});
// After: one player, applied everywhere
Playgent.init({
containerId: "playgent-host",
game: "sudoku",
mode: "daily",
player: "plyr_acme_blog",
});
Origins
The player loads only on origins you've allowed. Anything else is rejected.
- Add every domain you'll embed on, including
staging.acme.com,acme.com,www.acme.com. - Use wildcards like
*.acme.comif your blog/CMS spins up subdomains automatically. - For native apps, enable Allow embedding in iOS / Android WebViews on the player.
Identity
Pass externalUserId (and optional externalUsername) so completion events are tied to your user records:
Playgent.init({
containerId: "playgent-host",
game: "sudoku",
mode: "daily",
player: "plyr_acme",
externalUserId: "u_12345",
externalUsername: "alice",
});
These flow into the event log, the analytics stream, and signed webhooks — so you can join scores/completions back to your warehouse.
API keys
Server-to-server calls require a key:
curl -H "Authorization: Bearer pg_live_…" https://hub.playgent.com/api/v2/games
Keys are scoped — games:read, content:read, content:write, content:delete, players:read, players:write. Mint separate keys per service for least-privilege.
Webhooks
If you care about server-side delivery confirmation (audit logs, gating premium content, fraud signals), set up a webhook.
- Configure the endpoint and rotate the signing secret in Hub → Developers → Webhooks.
- Verify the
Playgent-Signatureheader before trusting any payload. - Tolerate retries — every event has a stable
id.
Plan & limits
Sandbox is free with a watermark. Starter / Pro / Enterprise lift session, player, and origin caps. Usage is visible in Hub → Settings → Workspace → Billing.
Support
Stuck? support@playgent.com.