Bounty Puzzle.
← Back to the journal
Developers

Iframe or custom API: choosing a puzzle-game integration

An iframe keeps game rendering separate from your application. A custom integration gives you more control—and more responsibility.

By Bounty Puzzle editorial team · Published · Updated

A logo as an lcd screen or a neon sign

An iframe integration displays a hosted puzzle experience inside another webpage. A custom API integration uses backend requests and your own application logic to control more of the experience. The right choice depends on which responsibilities you want to own: identity, rendering, session orchestration, payments and rewards.

What an iframe does well

An iframe gives the hosted game its own document and execution context. Your application can present the surrounding experience without reproducing every game interaction. That is useful when a small team wants to test a campaign without building and maintaining a separate puzzle interface.

It is not automatically secure just because it is embedded. Review the iframe's permissions, the domains you trust and any messages exchanged with the parent page. Test the dimensions and scrolling on the devices your visitors use.

What an API changes

API access lets your backend coordinate supported actions, but an API endpoint is not the same as a complete game UI. Read the current contract for the specific mode, including authentication, identifiers, expiry, errors and result handling.

Bounty Puzzle separates some account-level API operations from Host-plan operations. Confirm the current requirements in your dashboard and documentation before implementation. Do not assume every endpoint is included because one authenticated request works.

Decision Hosted iframe Custom integration
Game rendering Hosted game Depends on your implementation
Surrounding page Your application Your application
Integration effort Usually less UI ownership More coordination and maintenance
Backend identity Still your responsibility when used Your responsibility
Failure handling Required for loading and sessions Required across all owned components

Keep credentials on the backend

Never place a privileged API key in an iframe URL, public page source or browser bundle. Browser code is accessible to visitors. Where an operation requires a secret, have your backend authenticate it and give the browser only the limited information it needs.

For cross-window messages, check both the expected origin and the payload structure. Avoid using a wildcard target origin for sensitive information. MDN's postMessage reference explains the browser mechanics and their security implications.

Make failure states part of the design

Handle missing campaigns, expired sessions, denied access and network interruptions visibly. A blank game frame is not an explanation. Tell the visitor whether they can retry or must contact the host.

For results that trigger rewards, implement idempotency in your backend. Save a stable session/result identifier and ensure replayed or retried events cannot grant the same reward twice.

Choose a small implementation milestone

Start with one mode and one successful end-to-end session: load, activate if needed, play, finish and process the outcome. Then test negative paths before adding more modes. The examples show the product interactions; the API docs describe supported integration paths.

Can we use an iframe and API together?

Yes, where the mode supports it. The iframe can handle play while your backend coordinates identity, activation and downstream outcomes using supported requests.

Is custom hosting always cheaper?

No. Compare infrastructure with engineering, operational support and ongoing maintenance. A lower hosting bill does not necessarily mean a lower total cost.

Sources and further reading

Put it into practice

Build something people want to play.

Explore a working example, review the integration docs, or start your first campaign.

Keep reading

Tweet with bounty puzzle test embedded and playable Developer Notes

We Tested a Playable Puzzle Inside an X Player Card

Our free sliding puzzle worked inside a real X post. Here is how we built the trial, what we verified, and why successful rendering is not the same as platform approval.

Bounty Puzzle editorial team · 14 Oct 2026