# Connect the RPM app to a sandbox project

Canonical page: https://docs.ovok.com/example-rpm-app/sandbox-setup

Use this page when the demo is running and you want to test Patient sign-in and server-backed saves. Demo mode does not require a project or account.

## Set up the project [#set-up-the-project]

An Ovok project administrator should follow [project setup](/authentication/project-setup) and review [Access Policies](/access-policies). For this app:

1. Use a sandbox project and copy its tenant code.
2. Enable patient sign-in with [`PATIENT_LOGIN_ENABLED`](/settings-and-features/settings/patient-login-enabled).
3. Give the Patient AccessPolicy only the patient-scoped access needed for the Patient profile, Observation writes, and QuestionnaireResponse updates used by this app.
4. Enable [`transaction-bundles`](/settings-and-features/features/transaction-bundles) for SDK measurement saves. When changing the feature list, preserve other enabled entries because feature `PATCH` replaces the whole list.
5. Obtain an authorized Patient account in that tenant. The app signs in existing patients; it does not create projects or register patients.

An Ovok Console or administrator account is not a Patient account. Do not put a ClientApplication secret in the mobile app.

## Configure the app [#configure-the-app]

The example defaults to `https://api.sandbox.ovok.com` and tenant `public-example`. These values let the demo run; the tenant name does not grant permission to sign in. To use your own sandbox project:

```sh
cp .env.example .env
```

Set the API origin and tenant for the same environment:

```dotenv
EXPO_PUBLIC_OVOK_BASE_URL=https://api.sandbox.ovok.com
EXPO_PUBLIC_TENANT_CODE=your-sandbox-tenant-code
```

Restart Metro after editing `.env`. Expo includes every `EXPO_PUBLIC_` value in the client bundle, so use these fields only for public configuration. Never place passwords, tokens, or client secrets in this file.

## Sign in and verify a save [#sign-in-and-verify-a-save]

In Ovok Care, open **Settings → Sign in to your project** and enter the sandbox Patient credentials. If the account uses MFA, enter its verification code when prompted. Complete a test check-in and confirm its QuestionnaireResponse in the same sandbox Patient record. A server save failure remains visible as **Needs sync** and can be retried from the app.

For current account behavior, see [patient login](/authentication/patient-login), [patient registration](/authentication/patient-registration), and the [`transaction-bundles` feature](/settings-and-features/features/transaction-bundles).

**Explore the source:** [Settings.tsx](https://github.com/Ovok-Dev/rpm-mobile-app/blob/dev/src/Settings.tsx) implements sign-in and MFA continuation; [ovok.ts](https://github.com/Ovok-Dev/rpm-mobile-app/blob/dev/src/ovok.ts) configures the SDK client and environment; [storage.ts](https://github.com/Ovok-Dev/rpm-mobile-app/blob/dev/src/storage.ts) supplies persistent client storage.

## Troubleshooting [#troubleshooting]

| Problem | Check |
| --- | --- |
| Sign-in fails | Confirm API origin and tenant match, the account is a Patient in that tenant, patient sign-in is enabled, and the account has the expected AccessPolicy. See [authentication troubleshooting](/authentication/troubleshooting). |
| QuestionnaireResponse save fails | Confirm the Patient can update the response resource and that the app is signed in to that Patient. |
| Measurement shows **Needs sync** | Check connectivity and Patient write access; confirm `transaction-bundles` is enabled, then retry. |
| The previous tenant still appears | Stop and restart Metro after changing `.env`. |
