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

# Apps

> Publish a custom web app backed by your workflows — an HTML front-end that runs your published Tools

An App is a published web page with its own custom interface — a gallery, a form, a game, a client-facing tool — that runs your workflows behind the scenes. Apps live at `runchat.com/p/<handle>/<slug>`, anyone with the link can open them, and visitors who sign in run your workflows using their own credits.

For an overview of how Apps fit alongside Tools and Libraries, see [Tools, Apps, and Libraries](/concepts/publishing/libraries).

## How apps work

An app is an HTML page published as an [artifact](/concepts/dashboard/artifacts). The page runs in a sandboxed frame with a `window.runchat` bridge pre-injected, which lets it:

* **Run your published Tools** with `runchat.run(toolId, inputs)` — the workflow executes on the server and returns its outputs
* **Remember things per visitor** with `runchat.state` — a small per-app database for preferences, saved results, or galleries
* **Read who's viewing** with `runchat.user()`

Your workflows are the backend. There is no server code in an app — anything heavy (API calls, secrets, model runs) belongs in the workflow, published as a Tool. The app is only a UI.

## Building an app

1. **Publish the workflows first.** An app can only run workflows that have been published as [Tools](/concepts/publishing/custom-nodes).
2. **Ask the agent to build the interface.** Describe the app in chat — the agent writes the HTML into a Code node on the canvas. The canvas preview runs the same `window.runchat` bridge as the published page, so you can run tools and test the full experience before publishing anything.
3. **Publish via an Artifact node.** Connect the Code node's result to an [Artifact node](/node-reference/nodes/artifact) and run it. HTML that uses `window.runchat` is automatically published as an app.
4. **Share the URL.** To iterate, edit the HTML (or ask the agent to) and re-run the Artifact node.

## Accounts and billing

Visitors can open an app without a Runchat account, but need to sign in to run its workflows or save state. When a signed-in visitor runs the app, the run is billed to **their** account using their own credits and linked accounts — you don't pay for other people's runs.

Each app shows a "Powered by" banner listing the Tools it runs, linking back to each Tool's editor.

Note that a visitor's runs use the visitor's own account: API keys and integrations attached to your account are not available to their runs.

## State

`runchat.state` gives every visitor their own private key-value store scoped to the app — use it for chat history, saved images, game scores, preferences. A `shared` scope is readable by all visitors and writable only by you (the app owner), useful for leaderboards or curated content.

Generated media URLs saved into state are automatically copied to permanent storage, so a saved gallery keeps working after the provider's temporary URLs expire.

On the canvas preview, state is browser-local test state — it doesn't carry over when the app is published.

## Embedding apps

Apps embed cleanly in third-party sites like [Notion](https://notion.so). Most platforms accept a paste of the app URL and embed it as an iframe.

## Next steps

* [Tools, Apps, and Libraries](/concepts/publishing/libraries): how Apps relate to Tools and Libraries
* [Publishing Tools](/concepts/publishing/custom-nodes): publish the workflows your app will run
* [Build and publish an artifact](/examples/build-and-publish-an-app): worked example of publishing with the Artifact node
