Example app
The SDK repository contains an Expo example app for iOS and Android that uses every part of the SDK, with the token relay standing in for your backend.
Run it
You need Node.js 22 or later, and Xcode or Android Studio.
In the Developer Dashboard, create an API key (API keys → Create key) and turn on Enable client tokens under Client tokens.
Start the relay, and paste the key when it asks:
git clone https://github.com/January-ai/january-token-relay.git cd january-token-relay ./start.shIn a second terminal, clone the SDK repository and run the example:
git clone https://github.com/January-ai/january-sdk-react-native.git cd january-sdk-react-native cp example/.env.example example/.env corepack yarn install corepack yarn example ios # or: corepack yarn example androidThe
.envtemplate points at the relay on port 8787. On Android, the command starts an emulator if none is running and forwards the relay into it.Search for
banana. The relay printsminted=true status=201when the app gets its first token.
To reach a relay hosted elsewhere, set EXPO_PUBLIC_JANUARY_TOKEN_ENDPOINT to its token URL and EXPO_PUBLIC_DEMO_SESSION_TOKEN to its relay token. Setting EXPO_PUBLIC_JANUARY_API_KEY instead skips the relay in debug builds; keep that build on your machine (Development API key).
What each tab shows
Tab
SDK calls
Source in example/src
Search
foods.autocomplete, search, lookupBarcode, get, suggestAlternatives; foodAnalysis.analyzeDescription; restaurants.*; voice input
App.tsx, FoodDetailScreen.tsx, RestaurantScreens.tsx
Scan
foodAnalysis.analyzePhoto, correct
ScanScreen.tsx, scanCorrection.ts
Tracking
foodLogs.getSummary, list; waterLogs.*; weightLogs.*
TrackingScreen.tsx, TrackingCharts.tsx
Logs
foodLogs.*
FoodLogsScreen.tsx
Glucose
glucose.predict
GlucoseScreen.tsx
Files worth copying:
localDate.ts: the device timezone, localYYYY-MM-DDdates, and noon timestamps for past days.relayTokenProvider.ts: a token provider for the relay.VoiceInputButton.tsx: a tap-to-start, tap-to-stop microphone button.
Next: Client lifecycle.
Last updated
Was this helpful?