From 3b58d14fffdb5369a1d9642d7466eba37e14400b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 28 Aug 2026 14:18:21 -0500 Subject: [PATCH] Add React Native section to the README --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index c1d8f51..dcc3fae 100644 --- a/README.md +++ b/README.md @@ -459,6 +459,29 @@ summary for relay read message and verify event ``` +### Using it with React Native + +React Native requires polyfills: + +```sh +npm install react-native-get-random-values text-encoding-polyfill react-native-url-polyfill +``` + +Import the polyfills at the very top of your entry file (`index.js`), **before** anything that imports `nostr-tools`: + +```js +import 'react-native-get-random-values' +import 'text-encoding-polyfill' +import 'react-native-url-polyfill/auto' + +import { AppRegistry } from 'react-native' +// ... +``` + +Future versions of React Native may implement these features natively, allowing the polyfills to be removed. + +Note: `nostr-tools/wasm` will not work with React Native because it does not have WebAssembly support. + ## Plumbing To develop `@nostr/tools`, install [`just`](https://just.systems/) and run `just -l` to see commands available.