---
title: "Production"
description: "Build and run a Nuxt host with the editor module: runtime secrets, persistent storage and shutdown behaviour."
canonical_url: "https://skaile-ai.github.io/forge-editor/guides/production"
---
# Production

> Build and run a Nuxt host with the editor module: runtime secrets, persistent storage and shutdown behaviour.

```sh
bun run build                       # nuxt build
PORT=3200 node .output/server/index.mjs
```

- The module compiles the package source into the Nitro bundle (`externals.inline`) and enables `experimental.websocket` for the `/collab/:id` route. Verified with `node .output/server/index.mjs`: unauthenticated `GET /api/editor/settings` → 401, authenticated → 200; an unauthenticated websocket upgrade to `/collab/:id` gets 101 and is closed with 4401 (with `collab.authenticateUpgrade: true`: HTTP 401 at the upgrade), an authenticated provider syncs the document in both modes.
- Secrets and the session password are runtime environment variables of the server process (`NUXT_SESSION_PASSWORD` for `nuxt-auth-utils`, the `NUXT_TIPTAP_EDITOR_AI_*` keys of [AI configuration and secrets](https://skaile-ai.github.io/forge-editor/guides/ai-configuration)), not build-time values.
- Persistent data (documents, Yjs state, assets, settings) lives wherever the host's adapter puts it; Nitro storage mounts used by the adapter must be configured for production (`nitro.storage` with a real driver on read-only deployments).
- The server plugin's `installEditorServer` registers Nitro's `close` hook, which flushes pending debounced Yjs stores and disconnects the clients.


## Sitemap

See the full [sitemap](https://skaile-ai.github.io/forge-editor/sitemap.md) for all pages.
