Installation Guide

Install ZKAuth

Choose your platform and get ZKAuth running in minutes with our comprehensive installation guides.

Choose Your Platform

Select your preferred programming language or framework

javascript icon

JavaScript/TypeScript

Node.js, React, Vue, Angular, and more

python icon

Python

Django, FastAPI, Flask, and more

go icon

Go

High-performance Go applications

rust icon

Rust

Memory-safe systems programming

react icon

React

React hooks and components

vue icon

Vue.js

Vue 3 composition API

Installation Instructions

Follow these steps to install and configure ZKAuth

Installation

Install ZKAuth for JavaScript/TypeScript

bash
bash
# npm
npm install @zkauth/sdk

# yarn
yarn add @zkauth/sdk

# pnpm
pnpm add @zkauth/sdk

Basic Setup

Initialize ZKAuth in your JavaScript/TypeScript application

javascript
javascript
import { ZKAuth } from '@zkauth/sdk';

const zkauth = new ZKAuth({
  apiKey: process.env.ZKAUTH_API_KEY,
  baseUrl: 'https://api.zkauth.com'
});

Framework Integrations

Seamless integration with popular frameworks

Next.js

Server-side rendering and API routes

javascript
// 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,
    }),
  ],
})

Express.js

Node.js web application framework

javascript
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 });
});

Django

Python web framework

python
# 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})

Environment Configuration

Set up your environment variables and configuration

Environment Variables

Configure your API keys and endpoints

bash
bash
# 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_here

What's Next?

Continue your journey with ZKAuth

Ready to Install?

Get started with ZKAuth today and build secure applications.