Services live on One when they support both native platforms, and on
One.iOS when they expose an iOS capability. Hooks are named imports from
one. Use each reference for the complete signature, configuration, permission
behavior, event cleanup, and errors.
| API | What you can do |
|---|---|
| One.Notifications | Request permission, schedule and dismiss notifications, handle responses, obtain push tokens, and configure Android channels |
| One.Clipboard | Read, write, and check clipboard text |
| One.Network, useNetworkState | Read and subscribe to connection state |
| One.Browser | Open a system browser or authentication session and dismiss it |
One.Auth.Apple | Start Apple authorization on iOS; see the authentication section below |
| One.Haptics | Produce selection, impact, and notification feedback |
| One.AppInfo | Read the installed version, build, and application identifier |
| One.ImagePicker | Pick library media or use the system camera picker |
| One.DocumentPicker | Select documents with cancellation and file metadata |
| One.SecureStore | Store strings in Keychain or encrypted Android storage, asynchronously or synchronously |
| One.Database | Open and query SQLite databases through OP SQLite |
One.Speech | Request permission and start or stop speech recognition; see the dictation section below |
| One.LaunchScreen | Hold the launch screen until the app is ready, then hide it |
| One.Updates | Check, download, stage, and reload OTA bundles; the launcher handles early-failure rollback and cache pruning |
One.openURL, One.openShare, One.openSettings | Hand a URL, share payload, or settings request to the system |
| global crypto | Generate secure random values and UUIDs |
global fetch | Stream native HTTP responses and upload React Native file parts |
One.Auth.Apple is grouped under the shared authentication namespace, but Apple
authorization is an iOS operation. On Android and web, isAvailable is false and authorization calls reject.
Secure storage uses string keys and values:
import { One } from 'one'
export async function saveSession(token: string) { await One.SecureStore.setItem('session', token)}
export async function readSession() { return One.SecureStore.getItem('session')}
export async function clearSession() { await One.SecureStore.deleteItem('session')}A missing key reads null. SecureStore rejects on web; choose a separate web
session strategy. The synchronous verbs block the JavaScript thread, so reserve
them for a value needed synchronously, such as an initial session read.
These are exported on One.iOS; they do not acquire Android implementations
because the same app also uses Compose.
| API | What you can do |
|---|---|
| LocalAuthentication | Check biometric support and request system authentication |
| ProtectedStore | Protect Keychain items with biometric or device-passcode access policies |
| Storage | Fast synchronous key-value storage |
| Location | Request permission, locate, watch position, and geocode; background updates need configuration |
| MapServices | Search places, request suggestions, reverse-geocode, and obtain directions |
| FileSystem | Read and write sandbox files, inspect directories, and manage files |
| Audio | Play and record audio, configure background playback, and handle interruptions and Now Playing |
| CameraView | Render a camera preview and receive scanned codes |
| Share | Present the iOS share sheet and receive its result |
| PhotoLibrary | Save, query, export, and manage Photos assets and albums |
| ImageManipulator | Crop, resize, rotate, and encode local images |
| Contacts | Request access, search, create, update, delete, and use the system contact picker |
| Calendar | Manage events and reminders, including supported recurrence rules |
| Device | Read device and localization snapshots |
| Motion | Subscribe to available motion sensors |
| ScreenOrientation | Read, lock, unlock, and observe the active scene orientation |
| ScreenCapture | Observe capture state and screenshot events; capture a window or mounted view as PNG |
| Purchases | Read StoreKit products, purchase, restore, and observe transactions |
| BackgroundTasks | Register and schedule system-managed background work |
| DeviceAttestation | Use App Attest and DeviceCheck with app-owned server validation |
| AppTracking | Read and request tracking permission |
| AppIcon | Read and change configured alternate icons |
| KeepAwake | Control the app’s idle-timer flag |
| Present the system print sheet for a local PDF | |
| StoreReview | Request a system review prompt; iOS decides whether to display it |
| QuickActions | Manage Home Screen actions and receive warm or cold selections |
| Widgets, LiveActivities, WidgetUI | Update a generated WidgetKit extension and ActivityKit presentations |
Widget and Live Activity APIs need a generated extension, App Group, and the relevant signing capabilities. Native project setup shows the configuration. Widgets render a supported serialized JSX layout, not an arbitrary React Native subtree.
Configure native usage descriptions and capabilities before building the app, then request runtime permission from the corresponding API. A camera picker, camera preview, library picker, and Photos library management have different permission contracts. The system picker can select media without granting the app general library access.
A live network subscription returns an object with remove():
import { useEffect, useState } from 'react'import { One } from 'one'
export function useConnectionType() { const [type, setType] = useState('unknown')
useEffect(() => { const subscription = One.Network.addStateListener((state) => { setType(state.type) }) return () => subscription.remove() }, [])
return type}For a component that also needs the initial snapshot, use the exported
useNetworkState hook. Other services can return an unsubscribe function or
another handle; follow their own cleanup signature rather than assuming every
service uses remove().
One.Auth.Apple.isAvailable is a boolean. signIn accepts optional
requestedScopes ('fullName' and 'email'), state, and nonce, and
resolves a discriminated result. Cancellation resolves { type: 'cancel' }.
On success the credential includes the user identifier and nullable identity
token, authorization code, name, and email fields.
import { One } from 'one'
export async function signInWithApple() { if (!One.Auth.Apple.isAvailable) return null const result = await One.Auth.Apple.signIn({ requestedScopes: ['fullName', 'email'], }) return result.type === 'success' ? result.credential : null}Use getCredentialState(user) to read the credential’s current state. Enable
Sign in with Apple in the app’s entitlements and signing capabilities;
native.app.ios.usesAppleSignIn configures the One prebuild entitlement.
Your server owns credential verification and the session it creates.
One.Speech.isAvailable() reports native recognizer availability.
getPermissions() and requestPermissions() return permission responses.
After a grant, start({ lang? }, onEvent) returns a session with stop()
and abort(). lang is a language tag such as en-US.
The callback receives { type, transcript, error?, message? }; type is
start, transcript, end, or error. Each transcript is the whole result
so far. stop() finishes with a final event, while abort() tears down the
session silently. Configure native.app.speech with recognition and microphone usage
descriptions before prebuild. On web,
availability is false, permissions are denied, and start throws.
One.openURL(url) and One.openSettings() return Promise<void>.
One.openShare({ title?, message?, url? }) passes content to the system share
surface. On web, URL opening uses a new tab, sharing needs navigator.share,
and app settings are unsupported.
Native global fetch streams response bodies and accepts React Native file
parts in FormData. Use its standard request and response objects; no
One.fetch wrapper is required. Streaming is separate from
One.Network, which reports connection state.
Edit this page on GitHub.