Skip to content

Set up with your agent

Copy page

Two ways to get Nizhal into a project: let your coding agent set it up, or do it yourself.

Paste this into Claude Code, Codex, or any coding agent from your project folder:

Read https://nizhal-docs.pages.dev/start.md then set up Nizhal for this project.

The agent reads start.md and runs a two-phase setup:

  1. Scope it — it asks you five quick questions (one at a time, with recommended defaults; say “use defaults” to accept all):
    • What are you building? the core data that syncs → drives schema, mutators, sync rules.
    • Platforms? web / React Native / both → wa-sqlite vs op-sqlite.
    • Postgres? your connection string / provision Neon / local Docker.
    • Conflict model? LWW (default) / per-field merge / CRDT.
    • Realtime? in-process (default) / Postgres LISTEN-NOTIFY / Cloudflare.
  2. Scaffold — it installs @nizhal/*, models your domain (Drizzle schema + defineMutators + defineSyncRules), provisions Postgres with nizhal migrate, wires createNizhalServer + a TanStack DB client, and runs a convergence smoke.

This is intentionally light — project scoping, not a design interview. You can correct any answer; nothing is committed without your say.

Prefer to drive it manually? Follow the Quickstart — same steps, your hands on the keyboard.

The five answers map directly to real choices in the stack:

AnswerWhat it sets
DomainThe Drizzle schema, defineMutators, and defineSyncRules
PlatformswaSqlitePersistence (web) and/or opSqlitePersistence + @nizhal/react-native (RN)
PostgrespostgresStorage({ connectionString }) + nizhal migrate
Conflict modelmerge: "lww" | "field" | "crdt" per table (LWW is the default)
RealtimeinProcessRealtime / listenNotifyRealtime / cloudflareRealtime

See How sync works and Conflict resolution for the why behind each.