Template Repository

A comprehensive walkthrough of the Okto SDK Template Apps designed for Next.js. This template demonstrates core Okto functionality—including authentication, wallet management, and blockchain interactions—so you can quickly get started building with Okto.

Next.js Template Repository

Getting Started

For detailed installation instructions, select your framework below:

Next.js Template App
  1. Clone the repository:
git clone https://github.com/okto-hq/okto-sdkv2-nextjs-template-app.git
  1. Change into the project directory and install dependencies:
cd okto-sdkv2-nextjs-template-app
npm install
  1. Set up environment variables:
cp .env.sample .env
  1. Add your API keys to the .env file:
NEXT_PUBLIC_CLIENT_PRIVATE_KEY="YOUR_CLIENT_PRIVATE_KEY"
NEXT_PUBLIC_CLIENT_SWA="YOUR_CLIENT_SWA"
AUTH_SECRET="YOUR_AUTH_SECRET"
NEXT_PUBLIC_GOOGLE_CLIENT_SECRET="YOUR_GOOGLE_CLIENT_SECRET"
NEXT_PUBLIC_GOOGLE_CLIENT_ID="YOUR_GOOGLE_CLIENT_ID"

Note

To obtain these credentials:

  • Client Private Key & SWA: Get these from the Okto Dashboard. These keys are essential for authenticating your requests with Okto's services.

  • Google OAuth Credentials: Required for Google Sign-In functionality

    1. Set up a project in Google Cloud Console
    2. Create OAuth 2.0 credentials
    3. Follow our Google Console Setup Guide for detailed instructions
  • Auth Secret (Next.js only): Generate a secure random string for NextAuth.js session handling. You can create one by running:

    openssl rand -base64 32
  1. Start the development server:
npm run dev

On this page