Skip to main content

Create the project

Create your first app scaffolds the React and Vite notes starter. Its frontend is apps/main/src/main.tsx; its app tree is bijection/app.ts.

Connect, watch and mutate

apps/main/src/main.tsx
The generated app export gives typed references to the app’s exposed functions. useWatch keeps the latest notes live, and useMutation answers a Result: { ok: true, value }, or { ok: false, code, message } for a ctx.refuse(code, message) or a host refusal. The form needs no try/catch.

Add Bijection to an existing React frontend

  1. Install @bijectionhq/bijection in the frontend package.
  2. Set "browserClient": true in the backend’s bijection.json and run bijection check --write-lock. Import app and connect from .bijection/_generated/client.ts in that project.
  3. Set the installation URL, for example as VITE_BIJECTION_URL.
  4. Connect once and wrap the tree in <Bijection client>, as above.
To sign people in, see Connect and authenticate.

Deploy

Follow Create your first app and Frontend installations.