> ## Documentation Index
> Fetch the complete documentation index at: https://rollout.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Run an embedded app on your machine and load it with a signed context.

In this guide you'll run a small server that verifies Rollout's signed context
and greets the agent by name, register it as an app, and open it with a signed
sample from the Rollout dashboard.

**1. Get access and your client secret**

Rollout turns on Embedded Apps for each app publisher. [Contact us](https://rollout.com/docs/contact.md),
and we'll enable the **Embedded apps** section of your Rollout dashboard.

Your client secret is on the dashboard's **API** page, as the **Current
secret**. Rollout signs every context for your apps with it. Keep it on your
server:

```bash theme={null}
export ROLLOUT_CLIENT_SECRET="your current secret"
```

**2. Run the app**

Save this as `server.mjs`. It verifies the context, then serves a page that
greets the agent and loads Rollout's app script.

```js server.mjs theme={null}
import { createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const SECRET = process.env.ROLLOUT_CLIENT_SECRET;
const app = express();

function verifyContext(context, signature) {
  if (typeof context !== "string" || typeof signature !== "string") return null;

  const expected = createHmac("sha256", SECRET).update(context).digest();
  const actual = Buffer.from(signature, "hex");
  if (actual.length !== expected.length || !timingSafeEqual(actual, expected)) {
    return null;
  }

  const decoded = JSON.parse(Buffer.from(context, "base64url").toString("utf8"));
  if (decoded.x.exp < Date.now() / 1000) return null; // contexts last five minutes
  return decoded;
}

const escapeHtml = (s) =>
  String(s).replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);

app.get("/crm-panel", (req, res) => {
  const ctx = verifyContext(req.query.context, req.query.signature);
  if (!ctx) return res.status(401).send("This link is invalid or has expired.");

  const agent = ctx.user.name ?? ctx.user.id;
  const contact = [ctx.person?.firstName, ctx.person?.lastName].filter(Boolean).join(" ");

  res.send(`<!doctype html>
<html>
  <body style="font-family: sans-serif; margin: 16px">
    <p>Hi ${escapeHtml(agent)}. You're looking at
      <strong>${escapeHtml(contact || ctx.crm.personId)}</strong>.</p>
    <script type="module" src="https://universal.rollout.com/api/embedded-apps/app-v1.js"></script>
  </body>
</html>`);
});

app.listen(3000, () => console.log("http://localhost:3000/crm-panel"));
```

```bash theme={null}
npm install express
node server.mjs
```

A request without a valid context gets a 401 and never loads the app script,
so in a CRM it stays hidden rather than showing an error.

**3. Register the app**

In the Rollout dashboard, go to **Embedded apps → Apps** and choose
**Register an app**. Give it a name, and set its **App URL** to:

```
http://localhost:3000/crm-panel
```

`http` is allowed on `localhost` and `127.0.0.1` for development. Use your
real `https` URL before you list the app.

**4. Open a signed sample**

On your app's page, under **Test the signature check**, choose **Generate
sample**. Rollout generates your app URL with a context and signature, good
for five minutes, and shows the JSON it decodes to.

![The Test the signature check section of an app's page in the Rollout dashboard: a marketplace picker, a Generate sample button, the app's URL with a signed sample, and the context it decodes to](https://mintcdn.com/rollout/l0jLuVTIfNu5jYvw/images/embedded-apps/dashboard-test-signature.jpg?fit=max\&auto=format\&n=l0jLuVTIfNu5jYvw\&q=85\&s=440e39461a05973a4153664ee9c33801)

Open the URL. Your page greets the sample agent and names the sample
contact. If you get a 401, check that `ROLLOUT_CLIENT_SECRET` is your
**Current secret**, and that the sample hasn't expired.

Samples are previews: their agent and contact are made up, and
`x.preview` is `true`. See [Previews](https://rollout.com/docs/embedded-apps/verify-the-context.md#previews).

**5. List it in a marketplace**

Deploy the app to an `https` URL, update its App URL, and submit it to a CRM's
marketplace from **Embedded apps → Marketplaces**. Once the CRM approves it,
its users can turn it on. See [List your app](https://rollout.com/docs/embedded-apps/list-your-app.md).

## Next steps

* [Verify the context](https://rollout.com/docs/embedded-apps/verify-the-context.md): add the replay check,
  handle secret rotation, and see the Python version.
* [Context fields](https://rollout.com/docs/embedded-apps/context-fields.md): everything a context can
  carry, and how to link the agent to their account in your app.
* [Build the page](https://rollout.com/docs/embedded-apps/build-the-page.md): sign agents in, refresh
  the context, and set your framing headers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.