Choose your platform and get ZKAuth running in minutes with our comprehensive installation guides.
Select your preferred programming language or framework
Node.js, React, Vue, Angular, and more
Django, FastAPI, Flask, and more
High-performance Go applications
Memory-safe systems programming
React hooks and components
Vue 3 composition API
Follow these steps to install and configure ZKAuth
Install ZKAuth for JavaScript/TypeScript
# npm
npm install @zkauth/sdk
# yarn
yarn add @zkauth/sdk
# pnpm
pnpm add @zkauth/sdkInitialize ZKAuth in your JavaScript/TypeScript application
import { ZKAuth } from '@zkauth/sdk';
const zkauth = new ZKAuth({
apiKey: process.env.ZKAUTH_API_KEY,
baseUrl: 'https://api.zkauth.com'
});Seamless integration with popular frameworks
Server-side rendering and API routes
// pages/api/auth/[...nextauth].js
import NextAuth from 'next-auth'
import { ZKAuthProvider } from '@zkauth/nextjs'
export default NextAuth({
providers: [
ZKAuthProvider({
clientId: process.env.ZKAUTH_CLIENT_ID,
clientSecret: process.env.ZKAUTH_CLIENT_SECRET,
}),
],
})Node.js web application framework
const express = require('express');
const { ZKAuthMiddleware } = require('@zkauth/nodejs');
const app = express();
// Initialize ZKAuth middleware
const zkAuth = new ZKAuthMiddleware({
apiKey: process.env.ZKAUTH_API_KEY
});
// Protected route middleware
const requireAuth = zkAuth.authenticate();
app.get('/protected', requireAuth, (req, res) => {
res.json({ user: req.user });
});Python web framework
# settings.py
INSTALLED_APPS = [
# ...
'zkauth',
]
ZKAUTH_API_KEY = 'zka_...'
ZKAUTH_BASE_URL = 'https://api.zkauth.com'
# views.py
from zkauth.decorators import zkauth_required
@zkauth_required
def protected_view(request):
user = request.zkauth_user
return JsonResponse({'user': user})Set up your environment variables and configuration
Configure your API keys and endpoints
# Environment Variables (.env)
ZKAUTH_API_KEY=zka_live_your_api_key_here
ZKAUTH_BASE_URL=https://api.zkauth.com
# Development
ZKAUTH_API_KEY=zka_test_your_test_key_here
# Production
ZKAUTH_API_KEY=zka_live_your_production_key_hereContinue your journey with ZKAuth