SDK

React Native

No native modules, no pod install, no config plugin. It is JavaScript, and it ships the walls.

Install

npm
npm install @ripstop/react-native

Quickstart

App.tsx
import { RipstopProvider, asyncStorageAdapter } from '@ripstop/react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';

export default function App() {
return (
<RipstopProvider
apiKey="rs_pub_your_key"
appVersion={DeviceInfo.getVersion()}
storage={asyncStorageAdapter(AsyncStorage)}
>
<MyApp />
</RipstopProvider>
);
}

Or draw your own

tsx
const { decision, values, snooze, loading, refresh } = useRipstop();

if (decision.type === 'force') return <MyUpdateScreen {...decision} />;

Pass walls={false} to the provider and nothing is rendered for you.

Storage

The cache is in-memory unless you give it somewhere to live. AsyncStorage is a separate package and the SDK will not add it to your app on your behalf. Pass your existing instance through asyncStorageAdapter and the cache survives restarts.

The bug this SDK had to avoid

React Native has no crypto.subtle. @noble/ed25519 backs its SHA-512 with WebCrypto by default, so the obvious integration verifies signatures perfectly in every Node test and throws on the first real device.

This package wires SHA-512 explicitly from @noble/hashes, and has a test that deletes crypto.subtlebefore importing anything, because a test running on Node’s fallback would pass whether or not the fix was there. Removing the hook makes that test fail, which is the only reason it is worth having.

Options

PropDefaultWhat it does
apiKeyno defaultYour app’s public SDK key. Safe to ship
appVersionno defaultThe running build; rules evaluate against it
platformwebSet ios or android from Platform.OS
wallstrueRender the prebuilt screens, or take the decision yourself
themedarkColours for the walls; lightTheme is included
storagein-memoryWrap AsyncStorage with asyncStorageAdapter
onOpenUrlLinking.openURLHow to open the store
minFetchInterval6 hoursHow long a payload is fresh enough to skip the network

Set the platform

tsx
import { Platform } from 'react-native';

<RipstopProvider platform={Platform.OS as 'ios' | 'android'} />

Without it the SDK reads web rules, which most apps do not publish. Every decision then comes back none and nothing happens. It fails open, but it also fails silent.

Source

⌘K