Skip to main content

Prerequisites

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

1. Install the SDK

Run one of the following commands depending on your package manager:
or
This will add the Offline Protocol SDK as a dependency to your project.

Next Steps

SDK Setup

2. Import the SDK

Then, import the SDK client in your project:

3. Initialize the React App Provider with your project ID

Finally, wrap your application’s root component with OfflineAppProvider and pass in your project id. This project id 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.

4. Verify Your Setup

Test your SDK configuration with a simple API call:

5. Implement User Authentication

Now let’s add authentication to your application using the loginWithModal function. Use the useAuth hook to access the loginWithModal function: