OASIS Avatar SSO SDK - Next.js
Installation
npm install @oasis/avatar-sso-nextjsQuick Start (App Router)
1. Create Provider Component
// app/providers.tsx
'use client';
import { OasisSSOProvider } from '@oasis/avatar-sso-nextjs';
export function Providers({ children }: { children: React.ReactNode }) {
return (
<OasisSSOProvider
apiUrl={process.env.NEXT_PUBLIC_OASIS_API_URL || 'https://api.oasis.network'}
provider="Auto"
>
{children}
</OasisSSOProvider>
);
}2. Wrap Root Layout
3. Use in Components
4. Protected Routes with Middleware
Server-Side Authentication
API Route Handler
Server Component with Auth
Pages Router Support
Features
API Reference
Client Components
Server Actions (App Router)
Environment Variables
License
Last updated