EYMINT
DocumentationAPI Reference
BlogDashboard
EYMINT
SectionsDocumentationAPI Reference

Getting Started

  • Keymint Documentation
  • Introduction
  • Getting Started
  • License Keys
  • Changelog

SDK References

  • Software Development Kits (SDKs)
  • Node.js SDK
  • Go SDK
  • Python SDK
  • C# SDK

Integration Guides

  • Integration Guides
  • Customer Portal for Vendors
  • Roles & Permissions
  • Radar Alert Destinations
  • Payment Provider Integrations
  • Stripe Subscription Licensing
  • Email Delivery
  • API Key Management
  • Webhook Deliveries
  • Analytics and Retention
  • Dashboard Workflows
  • Electron Licensing
  • PyQt Licensing
  • Tauri Licensing
  • Next.js SaaS Licensing

Licensing Guides

  • Licensing Concepts
  • Node-Locking & Machine Identifiers
  • Floating Licenses
  • Offline Verification
  • License Radar
  • Public Key Management and Rotation
  • Feature Flags
  • Webhooks & Events

Templates

  • Starter Templates
  • Electron License Starter
  • PyQt License Starter
  • Tauri License Starter
  • Next.js SaaS License Starter

Security & Trust

  • Security & Trust

Support

  • Frequently Asked Questions
  • Customer Portal
  • Using the Customer Portal
  • Workspace Settings and Roles

Legal

  • Privacy Policy
  • Subprocessors
  • Data Processing Agreement
  • Security Overview
  • Terms of Service
  • Service Level Agreement (SLA)
  • GDPR Compliance
Go to Dashboard

Getting Started

  • Keymint Documentation
  • Introduction
  • Getting Started
  • License Keys
  • Changelog

SDK References

  • Software Development Kits (SDKs)
  • Node.js SDK
  • Go SDK
  • Python SDK
  • C# SDK

Integration Guides

  • Integration Guides
  • Customer Portal for Vendors
  • Roles & Permissions
  • Radar Alert Destinations
  • Payment Provider Integrations
  • Stripe Subscription Licensing
  • Email Delivery
  • API Key Management
  • Webhook Deliveries
  • Analytics and Retention
  • Dashboard Workflows
  • Electron Licensing
  • PyQt Licensing
  • Tauri Licensing
  • Next.js SaaS Licensing

Licensing Guides

  • Licensing Concepts
  • Node-Locking & Machine Identifiers
  • Floating Licenses
  • Offline Verification
  • License Radar
  • Public Key Management and Rotation
  • Feature Flags
  • Webhooks & Events

Templates

  • Starter Templates
  • Electron License Starter
  • PyQt License Starter
  • Tauri License Starter
  • Next.js SaaS License Starter

Security & Trust

  • Security & Trust

Support

  • Frequently Asked Questions
  • Customer Portal
  • Using the Customer Portal
  • Workspace Settings and Roles

Legal

  • Privacy Policy
  • Subprocessors
  • Data Processing Agreement
  • Security Overview
  • Terms of Service
  • Service Level Agreement (SLA)
  • GDPR Compliance

Next.js SaaS License Starter

Clone-and-run Next.js app with Keymint license management pre-configured. Setup page, license API route, and webhook handling included.

Quick Start

bash
git clone https://github.com/keymint-dev/keymint-nextjs-starter.git
cd keymint-nextjs-starter
npm install
cp .env.example .env.local
npm run dev

Opens a Next.js app at localhost:3000. /dashboard/licenses is a static page with setup steps. Create a license by sending POST /api/licenses with a customerEmail and an Authorization: Bearer $LICENSE_API_SECRET header; create products and monitor activations in the Keymint Dashboard.

What's Included

  • License dashboard — Starter dashboard page with setup instructions
  • Key generation — API route for creating license keys with customer details, protected by a shared secret
  • Webhook receiver — Verified Keymint outbound webhook handler with HMAC-SHA256 signature verification
  • License service — Server-side wrapper for create, block, unblock, query, and validate operations

Configuration

bash
KEYMINT_ADMIN_API_KEY=km_live_your_admin_key
KEYMINT_CLIENT_API_KEY=km_live_your_client_key
KEYMINT_PRODUCT_ID=YOUR_PRODUCT_ID
KEYMINT_WEBHOOK_SECRET=your_webhook_signing_secret
LICENSE_API_SECRET=your_shared_secret
VariableScopeWhere to Find
KEYMINT_ADMIN_API_KEYServerDashboard → Developer → API Keys (admin scope)
KEYMINT_CLIENT_API_KEYServerDashboard → Developer → API Keys (client scope)
KEYMINT_PRODUCT_IDServerDashboard → Products
KEYMINT_WEBHOOK_SECRETServerDashboard → Developer → Webhooks → your endpoint
LICENSE_API_SECRETServerYou choose it. Generate one with openssl rand -hex 32

Project Structure

text
src/
├── app/
│   ├── page.tsx                        # Landing page
│   ├── layout.tsx                      # Root layout
│   ├── api/
│   │   ├── licenses/route.ts           # License creation endpoint
│   │   └── webhooks/keymint/route.ts   # Keymint webhook receiver
│   └── dashboard/
│       └── licenses/page.tsx           # Static setup-instructions page
└── lib/
    ├── license-service.ts              # Keymint API wrapper
    └── require-secret.ts               # Bearer-secret check for POST /api/licenses

API Methods Used

FunctionWhereScopePurpose
createCustomerLicense()license-service.tsadminCreate a license with customer details
blockLicense()license-service.tsadminBlock a license key
unblockLicense()license-service.tsadminUnblock a license key
getLicenseInfo()license-service.tsadminQuery license details
validateLicense()license-service.tsclientValidate/activate a license

Deploy

bash
npm run build
# Deploy to Vercel, Railway, or any Node.js host

Set the KEYMINT_WEBHOOK_SECRET as the signing secret for your Keymint webhook endpoint. The URL should be https://yourdomain.com/api/webhooks/keymint.

POST /api/licenses uses your admin key, so it only accepts requests with Authorization: Bearer $LICENSE_API_SECRET and is meant to be called from your own backend. The license route and the webhook route both refuse requests until their secret is set. In production, create licenses from your payment provider's webhook after a successful checkout instead of exposing this route.

Next Steps

  • Add Stripe subscription licensing for automated key provisioning
  • Add a database (Drizzle, Prisma) to persist license and customer records
  • Add customer self-service portal for license management
  • Configure Keymint webhooks to point to /api/webhooks/keymint

On this page

  • Quick Start
  • What's Included
  • Configuration
  • Project Structure
  • API Methods Used
  • Deploy
  • Next Steps