Skip to main content
This tutorial walks through the full lifecycle of a page app on Prisme.ai: a React single-page app that lives inside a workspace, talks to backend automations, and is published at a shareable URL. By the end you’ll have a live page you can open at /apps/<slug> (inside the Platform) or /p/<slug> (standalone, optionally public). It ties together three existing references:

Pages

Authoring React pages and the host contract

Automations

Backend logic and webhook endpoints

Deployment

The Deploy modal, sharing, and embedding

What You’ll Build

A reusable page — for example an event “Request a demo” form — with:
  • A React UI authored either in Builder or locally with the starter-spa repo.
  • A backend automation (webhook endpoint) that receives the form submission.
  • Workspace configuration for secrets (API keys) read by the automation.
  • A published URL, served either to authenticated users or to anyone (public).

Procedure

1

Prerequisites

You need a workspace in AI Studio (open Create → Builder and create one if needed) and the rights to edit it. Pick a clear slug for the workspace — it becomes part of the published URL (/apps/<slug> or /p/<slug>).
2

Author the React app

Choose the workflow that fits you. Both produce the same kind of bundle and use the same host contract — the default export of src/App.tsx is what the platform renders, and it receives { sdk, user, workspace, backends, agents } as props.
  1. In the Builder sidebar, open Pages.
  2. Use + Page → New SPA to seed a starter React app (src/App.tsx, src/main.tsx, src/styles/globals.css, index.html, package.json, vite.config.ts).
  3. Switch to Code to edit the source, and Preview to compile and render it live.
  4. Click Save to sync the source files to the workspace.
See Pages for the editor, preview, and host contract details.
3

Wire a backend automation

Give the page a backend to call. Create an automation exposed as a webhook endpoint:
slug: submitForm
name: Submit form
when:
  endpoint: true          # public HTTP endpoint: /v2/workspaces/<id>/webhooks/submitForm
validateArguments: true
arguments:
  body:
    type: object
    properties:
      email: { type: string }
do:
  - emit:
      event: form.submitted
      payload:
        email: '{{body.email}}'
  - set:
      name: $http
      value:
        status: 200
output:
  ok: true
From the React app, POST to that endpoint (the SDK exposes the API host):
await fetch(`${sdk.host}/workspaces/slug:<workspace-slug>/webhooks/submitForm`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email }),
})
See Automations for endpoints, events, and fetch.
4

Configure secrets and config

If the automation needs credentials (an external API key, an email service, …), store them in the workspace configuration rather than in code. Declare them under config.value and read them in automations with {{config.*}}:
config:
  value:
    apiKey: <your-secret>
# inside an automation
- fetch:
    url: https://api.example.com/contacts
    headers:
      Authorization: Bearer {{config.apiKey}}
See Workspaces for configuration and secrets.
5

Build and deploy

Turn the source into a deployed bundle.
Click Deploy in the Builder header bar. The Publish step syncs unsaved source, builds the bundle, and registers it as the workspace’s current deployed bundle with a new version.
6

Choose how it opens and who can access it

In the Deploy modal, two settings decide the published experience:Display mode — “How should this app open?”
OptionURLResult
In Platform/apps/<slug>Wrapped in the Platform menu/shell.
Standalone/p/<slug>No Platform menu — the bundle owns the viewport and ships its own theme.
Access mode — “Who can access this app?”
OptionResult
Sign-in requiredVisitors are redirected to sign in first.
PublicAnyone can open it — no Prisme session needed.
A standalone, public combination (/p/<slug> + Public) is the right choice for an open landing page — e.g. a QR code at an event booth that anyone can scan and submit without logging in.
7

Get the URL or embed it

The modal surfaces the resulting links:
  • Platform URLhttps://<platform-host>/apps/<slug> (In Platform).
  • Public URL / Standalone URLhttps://<platform-host>/p/<slug> (Standalone).
To put the app inside another website instead, use the Share tab to generate an embed snippet (Inline, Popover, Modal, or Bottom Sheet). See Deployment for embed modes and data-* attributes.
Reuse the same page across contexts by reading a query parameter in the app (e.g. ?event=vivatech) and branching on it — one bundle, many landing pages.
8

Iterate

To ship a change, edit the source and deploy again (Deploy in Builder, or npm run release). Each deploy creates a new version, so you can roll back from the version history if needed.

Next Steps

Pages

Host contract, preview, and live updates

Automations

Webhooks, events, and orchestration

Deployment

Versioning, sharing, and embedding