Since React Native is based on React, you can utilize any hook from our React SDK to communicate with your Nhost backend project. However, please note that WebAuthn is currently not supported in React Native when using these hooks.

Polyfill Missing Base64 Decode

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:

    Terminal
    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:

    index.js
    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);