upwell/react
UpwellProvider, useAppUpdate, useUpdateHistory, useUpwell and useUpwellState.
import { UpwellProvider, useAppUpdate, useUpdateHistory, useUpwell, useUpwellState } from 'upwell/react';UpwellProvider
Owns an UpwellController and runs the launch and foreground checks.
<UpwellProvider
policy="https://cdn.example.com/upwell/policy.json"
releases="https://cdn.example.com/upwell/releases.json"
ota={expoUpdatesAdapter()}
debug={__DEV__}
>
<App />
</UpwellProvider>It accepts every UpwellOptions field, plus:
Prop
Type
Options are read once, when the provider mounts. To change them later, create a controller
with createUpwell() and pass it as controller.
useAppUpdate
What kind of update this user needs, and the actions to drive it.
const { decision, progress, isRequired, startUpdate, dismiss } = useAppUpdate();Prop
Type
startUpdate() and startStoreUpdate() resolve to a flow result
for store flows.
useUpdateHistory
OTA release notes from releases.json.
const { current, history, justUpdated, markSeen } = useUpdateHistory();Prop
Type
useUpwellState
The full UpwellState. Re-renders on every change.
const { installed, policy, policyWarnings, trace } = useUpwellState();useUpwell
The controller from the nearest provider. Throws outside one.
const upwell = useUpwell();
await upwell.check({ force: true });