This is a Next.js template pre-configured with Okto SDK for building chain abstracted decentralized applications. It provides a solid foundation for creating Web3-enabled applications with best practices and essential tooling.
- ⚡️ Next.js 14 with App Router
- 🔐 Okto SDK integration for seamless Web3 functionality
- 📱 Responsive Design out of the box
- 🔒 Authentication setup with NextAuth.js
Before you begin, ensure you have the following installed:
- Node.js 18.x or later and npm/pnpm/yarn
- Okto API Keys:
NEXT_PUBLIC_CLIENT_PRIVATE_KEY
andNEXT_PUBLIC_CLIENT_SWA
. Obtain these from the Okto Developer Dashboard. - Google OAuth Credentials
- Auth Secret
-
Clone this template:
git clone https://github.com/okto-hq/okto-sdkv2-nextjs-template-app.git cd okto-sdkv2-nextjs-template-app
-
Install dependencies:
npm install
-
Set up your environment variables:
cp .env.sample .env
Edit
.env
and add your Okto API credentials and other required environment variables.# The Okto environment "sandbox" or "production" NEXT_PUBLIC_ENVIRONMENT = "sandbox" # Get the below values from Okto Developer Dashboard. Learn how here- https://docsv2.okto.tech/docs/developer-admin-dashboard NEXT_PUBLIC_CLIENT_PRIVATE_KEY = "YOUR_CLIENT_PRIVATE_KEY" NEXT_PUBLIC_CLIENT_SWA = "YOUR_CLIENT_SWA" # Generate using command: openssl rand -base64 32 AUTH_SECRET = "YOUR_AUTH_SECRET" # Only needed if google authentication is used GOOGLE_CLIENT_ID = "YOUR_GOOGLE_CLIENT_ID" GOOGLE_CLIENT_SECRET = "YOUR_GOOGLE_CLIENT_SECRET"
-
Start the development server:
npm run dev
-
Open http://localhost:3000 with your browser to see your application.
This template can be easily deployed to Vercel:
For other deployment options, follow the Next.js deployment documentation.
- Okto SDK Documentation
- Next.js Documentation
- Learn Next.js - an interactive Next.js tutorial.
Contributions are welcome! Please take a moment to review our CONTRIBUTING.md guidelines before submitting any Pull Requests. Your contributions are invaluable to the Okto community.