Configuration
How to point the SDK at your project and toggle the few connection-level behaviors. UI customization (theme, layout, callbacks) lives in the React Native Widget reference.
Minimum Setup
<Qafka />The widget initializes the SDK on mount. Project, theme, greeting, and tools are resolved automatically — in development from the CLI-generated qafka.config.js, in production from the device attestation certificate.
Connection Options
These are the props on <Qafka /> that affect SDK initialization and runtime behavior:
| Option | Type | Default | Description |
|---|---|---|---|
projectId | string | runtime-config default | Project the SDK should use when the runtime config registers more than one project. Pass a registered id to switch (e.g. <Qafka projectId="proj_abc123" />). Unknown ids throw on mount — silent fallback would mask a typo. |
apiUrl | string | Production URL | Backend API endpoint. Override for self-hosted or custom deployments. |
subProjectId | string | — | Routes the SDK to a specific sub-project under the active project. See Sub-Projects for the full multi-tenant story. |
Multiple projects (per-platform, per-flavor, sub-brand)
Register every project once with the CLI; the runtime config keeps them all available, and you switch with the projectId prop:
qafka project # add another project to .qafka/config.jsonimport { Platform } from 'react-native'
<Qafka projectId={Platform.OS === 'ios' ? 'proj_ios_abc' : 'proj_android_xyz'} />This is also the right pattern for separating staging vs production builds, or one app shell that serves multiple sub-brands. See Dashboard › API Keys for managing the underlying keys.