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.
npm install @solidus-network/sdkStep 2: Initialize the client. Create `lib/solidus.ts`:
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.
Okumaya Devam Edin
Tüm makaleleri görüntüle →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.