Reference
React Native SDK
Install and configure @unitcms/react-native.
Install
terminal
npx expo install @unitcms/react-native @react-native-async-storage/async-storageExpo is fully supported, and so is a bare React Native app.
Initialize
import { Unit } from "@unitcms/react-native"
const unit = Unit({
project: "proj_123",
token: "unit_prod_pub_..."
})| Option | Type | Description |
|---|---|---|
project | string | Your project ID |
token | string | A delivery key for one environment |
Methods
| Method | Returns |
|---|---|
unit.content(type).list(options?) | Published entries of a type |
unit.content(type).get(id) | A single published entry |
unit.config.get() | Typed config values |
unit.flag(key) | A boolean, synchronously |
Generated types
Type generation is on the roadmap. The goal is one command that turns your schemas into TypeScript types.
Planned
npx unitcms generate