# Quickstart: iframe or WebView

> Show your first quest in the hosted embed, from any website, with one backend route and a few lines of JavaScript.

Source: https://dashboard.adquest.batriders.ir/docs/quickstart-embed · Audience: Developers · Section: Get started

## Prerequisites

- The publisher’s accepted and active platform, with its Embed URL and public API key.
- Your site’s address on the platform’s Where AdQuest may appear list, if the publisher keeps one.
- A backend route that creates participant sessions. Use the one from the Quickstart.

- [What to ask the publisher for](https://dashboard.adquest.batriders.ir/docs/environments#what-to-ask): Keys, the Embed URL and allowed addresses.
- [Quickstart: the backend route](https://dashboard.adquest.batriders.ir/docs/quickstart#backend-route): Step 1 of the React quickstart.

## 1. Load the embed and send the session

The page waits for adquest:ready from the embed, asks your backend for a session, then sends adquest:init.

**index.html**

```html
<iframe id="adquest" title="AdQuest rewards" style="width:100%;height:720px;border:0"></iframe>
<script type="module">
  const frame = document.getElementById("adquest");
  const origin = "https://sdk.adquest.batriders.ir";
  window.addEventListener("message", async (event) => {
    if (event.origin !== origin || event.source !== frame.contentWindow) return;
    const message = typeof event.data === "string" ? JSON.parse(event.data) : event.data;
    if (message?.version !== 1 || message.type !== "adquest:ready") return;
    const session = await fetch("/api/adquest/session", { method: "POST" }).then((response) => response.json());
    frame.contentWindow.postMessage({ version: 1, type: "adquest:init", payload: { apiKey: "YOUR_PUBLIC_API_KEY", ...session } }, origin);
  });
  frame.src = origin + "/YOUR_PLATFORM_PUBLIC_ID";
</script>
```

> **This version is for a first test.** It does not refresh the token or show errors. Add both before launch with the iframe guide. For a native app, follow the WebView steps there.

- [Hosted iframe & WebView](https://dashboard.adquest.batriders.ir/docs/embed): Refresh, errors, language and native WebViews.

## 2. What you should see

- The embed loads with the publisher’s branding and shows the quests and the token balance.
- Opening and completing a quest adds tokens to the balance.

- [Nothing appears](https://dashboard.adquest.batriders.ir/docs/troubleshooting#empty-feed): Check approval, activation, origins and the API URL.
- [Bridge messages](https://dashboard.adquest.batriders.ir/docs/bridge-messages): Every message between your page and the embed.

## Next steps

- [Hosted iframe & WebView](https://dashboard.adquest.batriders.ir/docs/embed): The complete guide.
- [Test & go live](https://dashboard.adquest.batriders.ir/docs/launch): Check the full journey before launch.
