Skip to content

React Native Support

In an environment like React Native (running JSCore) that does not support atob or btoa, a polyfill is needed. Follow these steps to implement the polyfill and enable full compatibility with the Nhost SDK

  1. Install base-64:

    npm install base-64
  2. In the index.js file, which is the entry point for React Native applications, add the following import and global assignment:

    import 'react-native-gesture-handler';
    import { AppRegistry } from 'react-native';
    import App from './src/root';
    import { name as appName } from './app.json';
    import { decode as atob } from 'base-64'; // Import decode function
    global.atob = atob; // Assign atob to global for polyfill
    AppRegistry.registerComponent(appName, () => App);