SDK
React Native
No native modules, no pod install, no config plugin. It is JavaScript, and it ships the walls.
Install
npm install @ripstop/react-nativeQuickstart
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
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
| Prop | Default | What it does |
|---|---|---|
apiKey | no default | Your app’s public SDK key. Safe to ship |
appVersion | no default | The running build; rules evaluate against it |
platform | web | Set ios or android from Platform.OS |
walls | true | Render the prebuilt screens, or take the decision yourself |
theme | dark | Colours for the walls; lightTheme is included |
storage | in-memory | Wrap AsyncStorage with asyncStorageAdapter |
onOpenUrl | Linking.openURL | How to open the store |
minFetchInterval | 6 hours | How long a payload is fresh enough to skip the network |
Set the platform
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
- github.com/ripstop-dev/ripstop-react-native (MIT).
- 74 tests: 62 golden vectors, the failure paths, and the WebCrypto-less path.