Web3 Auth

Zero to Solidus Auth — Next.js Quick Start

Y
Yasin Yıldırım
Co-Founder & Chief Protocol Engineer
8 min read

This guide walks you through replacing a standard NextAuth.js setup with Solidus credential-based authentication. We'll go from zero to a working integration in just a few steps.

Prerequisites: Node.js 18+, a Next.js 14+ project, a Solidus API key from docs.solidus.network.

Step 1: Install the SDK.

bash
npm install @solidus-network/sdk

Step 2: Initialize the client. Create `lib/solidus.ts`:

typescript
import { SolidusClient } from '@solidus-network/sdk'

export const solidus = new SolidusClient({
  apiKey: process.env.SOLIDUS_API_KEY!,
  mode: process.env.NODE_ENV === 'production' ? 'live' : 'sandbox',
})

Step 3: Create a verification API route at `app/api/verify/route.ts`. The route accepts a credential presentation, validates the signature against the on-chain DID document, and returns the verified claims.

Step 4: Add the verification flow to your sign-up/sign-in component. Users with an existing Solidus credential click once to present it. New users are redirected to the KYC flow.

Step 5: Configure your middleware to check for a valid session credential on protected routes.

The full integration — including error handling, session management, and webhook setup for credential revocation events — is covered in the complete guide at docs.solidus.network.

Entegre etmeye hazır mısınız?

Eski kimlik doğrulama sağlayıcınızı bugün değiştirin. Kredi kartı gerekmeden ayda 1,000 ücretsiz doğrulama hakkı kazanın.

Kopyala-yapıştır Next.js şablonları
Sıfır bilgi kanıtı doğrulaması
W3C Doğrulanabilir Kimlik Bilgileri desteği

Solidus Araştırma Laboratuvarı'na Katılın

Haftalık teknik makaleleri, protokol güncellemelerini ve sektör analizlerini doğrudan e-posta kutunuza alın.

Spam yok. İstediğiniz zaman abonelikten çıkabilirsiniz. Gizlilik Politikamızı okuyun.

Zero to Solidus Auth — Next.js Quick Start — Solidus Blog