This repository is a pnpm workspace with two main packages:
packages/react-native: the published SDK (@formbricks/react-native). Source lives insrc/, grouped by domain undersrc/lib/, with React components insrc/components/and shared types insrc/types/.apps/playground: an Expo app for manual testing and integration checks. App code is insrc/, with static assets inassets/.
GitHub Actions under .github/workflows/ enforce build, lint, type-check, test, and release steps.
Run commands from the repository root unless package-scoped work is needed.
pnpm install --frozen-lockfile: install workspace dependencies.pnpm dev: run Turbo watchers across packages.pnpm build: build the SDK and playground.pnpm lint: enforce exact dependency versions, then run Biome checks.pnpm check-types: run TypeScript checks across the workspace.pnpm test: run unit tests with Vitest.pnpm test:coverage: generate coverage reports used in release validation.pnpm --filter playground ios/pnpm --filter playground android: launch the Expo playground on a device target.
Use TypeScript with strict compiler settings. Biome is the formatter and linter; run pnpm format before large refactors. The repo uses spaces for indentation, double quotes, and semicolons.
Follow existing naming patterns: React components in lowercase kebab-style filenames such as survey-web-view.tsx, domain modules in concise lowercase names such as state.ts, and tests as *.test.ts. Keep imports using the @/ alias inside packages/react-native when referencing src/.
Unit tests live beside each domain under src/lib/**/tests/. Prefer small, focused Vitest suites and place reusable doubles in local __mocks__/ folders. Add or update tests with every behavior change; there is no published coverage threshold, but test:coverage is part of the release workflow, so changed code should stay covered.
Recent history mostly follows Conventional Commit-style subjects such as feat:, fix:, and chore: with short imperative summaries. Keep commits narrowly scoped and descriptive.
PRs should include a clear summary, linked issue if applicable, and the commands you ran locally (pnpm lint, pnpm check-types, relevant tests). Include screenshots or screen recordings when a playground or UI behavior changes. Avoid loose dependency ranges: this repo enforces exact versions in every package.json.