Skip to main content

Prerequisites

  • Node.js version 18.x or higher
  • React version 19.x or higher
  • A package manager: npm or yarn

1. Install the SDK

Run one of the following commands depending on your package manager:
npm install @offline-protocol/id-react-native
or
yarn add @offline-protocol/id-react-native
This will add the Offline Protocol SDK as a dependency to your project.

Next Steps

Obtain your api-key

2. Import the SDK

Then, import the SDK client in your project:
import { OfflineAppProvider } from "@offline-protocol/id-react-native";

3. Initialize the React App Provider with your API key

Finally, wrap your application’s root component with OfflineAppProvider and pass in your API key. This API key is required for authenticating all requests made to the Offline Protocol Identity Service. Once initialized, you can access SDK functionality anywhere in your app using the provided hooks.
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import { OfflineAppProvider } from "@offline-protocol/id-react";

const API_KEY = "your-api-key-here";

export default function RootLayout() {
  return (
    <OfflineAppProvider apiKey={API_KEY}>
      <Stack></Stack>
    </OfflineAppProvider>
  );
}
I