Create your first Ovok app

Scaffold a web and mobile workspace connected to the Ovok sandbox, sign in, and list your project's patients.

Complexity
1/5
Clients
Web, React Native
Time
10 minutes

create-ovok sets up a Turborepo with a web app, a mobile app or both, already connected to your Ovok project. The web app signs a practitioner in and lists the project's patients, so you can see data flow end to end before you write any code.

Set upConsole

You need:

  • Node.js 22 or newer and pnpm.
  • An Ovok project and its tenant code. Set up your project shows where to find it.
  • A practitioner account in that project, to sign in to the web app.
  • For the mobile app, Xcode or Android Studio to build the development client.

Create the workspaceTerminal

Run create-ovok with the name of your workspace folder:

Terminal
pnpm create ovok my-app

It asks for the apps you want and your tenant code, then installs dependencies and makes the first git commit. The recommended setup creates a web app and a mobile app for iOS and Android, pointed at the sandbox.

Flags answer the questions up front, which is useful in scripts:

FlagAnswers
--platform web|mobile|mobile-webThe apps to start with
--type ios|androidOne mobile platform instead of both
--tenant {{TENANT_CODE}}Your Ovok tenant code
--base-url https://api.sandbox.ovok.comThe Ovok API URL
--yesEvery other question, with the recommended setup
--skip-installLeaves pnpm install to you
--disable-gitLeaves the folder without a git repository

The result:

  • apps/ holds the apps you chose.
  • .env sets OVOK_BASE_URL and OVOK_TENANT_CODE for every app.
  • .mcp.json registers the Ovok MCP server, so coding agents in the workspace can read your project.
  • Each app has an AGENTS.md with the Ovok rules for coding agents, and a CLAUDE.md that imports it.

Start the web appClient-side

Terminal
cd my-app
pnpm dev

The web app creates one client for the whole app from .env:

apps/web/src/ovok.ts
import { Ovok } from '@ovok/core/next';

export const ovok = new Ovok({
  baseUrl: import.meta.env.OVOK_BASE_URL,
  tenantCode: import.meta.env.OVOK_TENANT_CODE,
  fhirPath: '/fhir/R4/',
});

Sign in with your practitioner's email and password. The app calls ovok.auth.login and then searches the project's Patient resources.

Verify your integration

You should see a list of up to 10 patients from your project, or an empty list in a new project. If you don't:

  1. Check that .env has your tenant code and https://api.sandbox.ovok.com.
  2. Check that the account is a practitioner in that project.
  3. Look up the error the app shows in Errors.

Start the mobile appClient-side

The mobile app runs in an Expo development client, which you build once per platform:

Terminal
cd apps/mobile
pnpm ios      # or: pnpm android

After the first build, pnpm dev starts the bundler and the installed client reloads as you edit.

Test your integration

  1. Start the web app and sign in as a practitioner.
  2. Create a patient in the project, for example with the Slim API.
  3. Sign in again and check the new patient appears.
ScenarioHow to trigger itExpected result
Signed inValid practitioner email and passwordThe patient list
Wrong passwordAny other passwordAn error message; no list
Second factor neededAn account with MFA onA note to finish with ovok.auth.verifyMfa

Optional: Grow the workspaceTerminal

Add apps and shared code with the generators create-ovok installed:

Terminal
pnpm turbo gen app       # add a web or mobile app
pnpm turbo gen package   # add a shared package
pnpm turbo gen agents    # refresh the Ovok rules in every AGENTS.md

See also

Last updated on

On this page