React Native Quick Crypto
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).

index.ts
import { install } from 'react-native-quick-crypto';

Execute

Call install() before any other imports that might depend on crypto.

index.ts
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?

  1. global.Buffer: Via @craftzdog/react-native-buffer.
  2. global.crypto: Points to QuickCrypto.
  3. global.process: Adds process.nextTick (mapped to setImmediate).

On this page