API Reference
install
Global polyfill injection
The install() function is a helper that patches the global JavaScript environment to make react-native-quick-crypto behave as a drop-in replacement for Node.js crypto.
This modifies global.Buffer and global.crypto. Ensure you want this global side-effect before calling.
Installation Flow
Import
Import the install function at the very top of your application's entry file (e.g., index.js).
import { install } from 'react-native-quick-crypto';Execute
Call install() before any other imports that might depend on crypto.
install();
// Now import your App
import App from './src/App';Verify
You can now use global crypto without imports.
// Anywhere in your app
const id = crypto.randomUUID();
const buf = Buffer.from('hello');What gets polyfilled?
global.Buffer: Via@craftzdog/react-native-buffer.global.crypto: Points toQuickCrypto.global.process: Addsprocess.nextTick(mapped tosetImmediate).