Skip to main content

Step 1: Set up your local environment

Clone the following GitHub repository to get started:
git clone https://github.com/Offline-Protocol/id-sdk-react-test-app.git
cd id-sdk-react-test-app
This repository contains the SDK and example code to help you integrate quickly.

Step 2: Run as a Next.js app

  1. Install dependencies:
    npm install
    # or
    yarn install
    
  2. Start the development server:
    npm run dev
    # or
    yarn dev
    
  3. Open http://localhost:3000 to see your app live.

Step 3: Configure your API key

Create an API key To interact with Offline Protocol, you’ll need an API key.
  1. Visit the API Keys page.
  2. Generate a new key and copy it.
  3. Store it securely in your environment file:
NEXT_PUBLIC_OFFLINE_API_KEY=your_api_key_here
Set API key in the Provider Wrap your app with the OfflineProvider and pass the API key:
import { OfflineProvider } from "@offline-protocol/id-react";

export default function App({ Component, pageProps }) {
  return (
    <OfflineProvider apiKey={process.env.NEXT_PUBLIC_OFFLINE_API_KEY}>
      <Component {...pageProps} />
    </OfflineProvider>
  );
}

Step 4: Go live

Deploy your Next.js app” You can deploy your app to any hosting service (e.g. Netlify).
  1. Push your code to GitHub.
  2. Connect your repo to the hosting provider.
  3. Add the NEXT_PUBLIC_OFFLINE_API_KEY in your hosting environment variables.
  4. Deploy and your app is live!

Next steps

Now that you have Offline Protocol running, check out these features:
Need help? Check out the full documentation or join the community forum.
I