Waleed b446b42018 feat(consent): cookie consent banner and cookie policy (#6832)
* feat(consent): add a hosted-only cookie consent banner

Adds a c15t-backed consent runtime and a Sim-styled banner, mounted from
the root layout only when `isHosted` is true. A self-hosted deployment
never mounts the runtime, so it makes no request to Sim's consent backend
and never sees the banner.

The banner is a non-modal card docked bottom-left, opposite the toast
stack, built from the same chrome (border, --bg, --shadow-overlay) and
from Chip/Switch/Label rather than c15t's own components — the runtime is
imported from `@c15t/nextjs/headless`, which ships no UI or stylesheet.
"Customize" expands the same card into per-category switches instead of
opening a dialog over the app. Visibility and the available actions come
from the jurisdiction policy the runtime resolves, and accept and reject
are rendered with identical weight.

* feat(consent): cookie policy page, CSP allowance, and design-system alignment

The consent backend was blocked by our own CSP, so the runtime silently fell
back to an offline policy that showed the banner to every visitor worldwide and
recorded nothing. The backend origin now lives in lib/consent/constants and the
CSP builder allows it from that single source.

Banner: mount the runtime beside the app rather than wrapping it, behind a
dynamic() boundary, so consent state cannot re-render the page tree and a
self-hosted build never fetches the chunk. Align chrome with the toast card
(z token, font scale, --text-body/--text-muted pairing) and mirror the light
token layer the public shells pin, which a dark-theme visitor on a landing
route outside ThemeProvider's forced list would otherwise miss. Read the
category list from the store's own getDisplayedConsents() — the shipped
defaults mark every category except necessary as display:false, so the
hand-rolled filter rendered a one-row list.

Docs: add /cookie-policy as a third ProsePage consumer with the cookie
inventory in tables (a new table block kind on the shared primitive),
cross-reference it from the Privacy Policy, and wire it into the sitemap and
llms.txt. The policy promises consent can be changed at any time, so the
banner can be reopened from it.

* refactor(consent): apply the cleanup pass

- Drop the .light DOM probe: it matched the banner's own element, so once set
  it could never flip back, and it went stale on a theme toggle with no
  navigation. The card now pins the light layer unconditionally, as every other
  public surface does.
- Hoist the motion/style objects to module scope.
- Move a chip's mr-auto into the row layout; chips carry no outer margin.
- Use the shadow-overlay utility and --border rather than the legacy alias.
- Render <caption> before <colgroup>, which the HTML spec requires.
- Make the code formatting of a table column a renderer concern (codeColumns)
  instead of JSX smuggled into the row content.
- Raise the table caption above body weight, and tighten comments.

* refactor(consent): apply the simplify pass

The consent runtime installs a childList+subtree MutationObserver on
document.body for its iframe blocker, for the life of every hosted page —
including the workflow canvas — and re-scans each added subtree. Sim gates no
iframes by consent, so disableAutomaticBlocking turns it off.

Also: collapse the ConsentProvider passthrough into the dynamic() export; move
ConsentPreferencesLink under (landing)/cookie-policy so a shell module no
longer imports landing chrome; build the three cookie tables from one shape;
move the table column widths into the prose chrome layer; only compute the
category list when the card is expanded; drop the ConsentCategory cast; express
the card width in Tailwind rather than an inline style.

Comment corrections: the sibling mount is forced by ssr:false, not by
re-render concerns; lib/consent/constants must stay dependency-free because
next.config loads it and the browser bundles it; codeColumns exists for
biome's useJsxKeyInIterable, not for React; the headless entry omits the
components but the provider still injects an inert --c15t-* style block.

* fix(consent): address the first review round

- Add /cookie-policy to LANDING_ROUTES. It is an app/(landing) route, and
  every one of those must be exempt from COEP: the header is inherited across
  soft navigations, so an isolated landing page navigating into /demo leaves
  the Cal.com booker loading uncredentialed.
- Render the withdrawal control as plain text on a self-hosted deployment,
  where the consent runtime is never mounted and the button had no listener.
- Give ConsentPreferencesLink a named props interface.
2026-08-18 17:08:27 -07:00

Sim.ai Documentation Slack X

Ask DeepWiki Set Up with Cursor

Sim — Integrate, Context, Build, and Monitor AI agents

A workspace to build, deploy and manage AI agents and workflows.

Quickstart

Cloud-hosted: sim.ai

Open sim.ai

Self-hosted

git clone https://github.com/simstudioai/sim.git && cd sim
bun install
bun run setup

Open http://localhost:3000

The Sim platform — chat on the left, the visual workflow builder on the right

Capabilities

  • Connect 1,000+ integrations and every major LLM
  • Add Slack, Notion, HubSpot, Salesforce, databases, and more
  • Build agents visually, conversationally, or with code
  • Ingest files, knowledge bases, and structured table data
  • Monitor runs, logs, schedules, and workflow activity

One workspace, every surface

Chat and workflows are just the start — tables, files, and knowledge all live in the same workspace.

Tables in Sim — structured data your agents can query

Tables — a database, built in

Files in Sim — documents for your team and every agent

Files — one store for your team and every agent

Knowledge bases in Sim — synced docs your agents can search

Knowledge — your agents' memory

Self-hosting

Requirements: Bun and Docker.

bun run setup is an interactive wizard: it provisions the database, generates secrets, writes your .env files, connects a Chat API key, and starts Sim the way you choose:

  • Local dev — run from source to contribute or hack on Sim
  • Docker Compose — a self-contained instance for testing self-hosting
  • Kubernetes (Helm) — deploy to a local cluster

When it finishes, open http://localhost:3000.

Reconfigure an optional capability without rerunning the full wizard:

bun run setup status
bun run setup email
bun run setup storage
bun run setup sandbox
bun run setup jobs
bun run setup cache
bun run setup knowledge
bun run setup llm
bun run setup integration slack

bun run setup status detects the effective local-dev, Docker Compose, or current-context Helm configuration and reports configured, missing, or invalid capabilities and OAuth integrations without printing credential values. This is separate from bun run sim status, which reports whether installed services are running and healthy.

Manage your install with bun run sim:

bun run sim start | stop | restart   # bring your install up / down / cycle
bun run sim update                   # pull/rebuild and apply Compose images
bun run sim status                    # what's installed and healthy
bun run sim logs                      # follow logs
bun run sim doctor                    # diagnose configuration problems
bun run sim down                      # remove containers (data kept)
bun run sim reset                     # archive .env and wipe managed data

sim detects how you're running (Docker Compose, local dev, or Kubernetes) and acts accordingly.

Prefer a bare sim? Run bun link once — but note sim lands in ~/.bun/bin, which Homebrew's bun doesn't add to your PATH, so you may need export PATH="$HOME/.bun/bin:$PATH" in your shell profile.

Sim also supports local models via Ollama and vLLM. See the self-hosting docs for details.

Chat API Keys

Chat is a Sim-managed service. bun run setup connects a Chat API key for you — sign in when it opens your browser and the key is stored automatically. To view, create, or revoke keys later, go to sim.ai/selfhost/settings/chat-keys.

Environment Variables

See the environment variables reference for the full list, or apps/sim/.env.example for defaults.

Tech Stack

Next.js · Bun · PostgreSQL · Drizzle · Better Auth · Tailwind — and the rest of the stack

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Built by the Sim team in San Francisco

Languages
TypeScript 77%
MDX 20.8%
JavaScript 1.9%
CSS 0.1%