Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lintliot.com/llms.txt

Use this file to discover all available pages before exploring further.

The LintLiot SDK is a single npm package that works across every major Node.js framework. After you install it and run npx lintliot init, the SDK inserts itself into your request lifecycle automatically — before any of your routes run — so every incoming request is inspected and filtered without you having to change your application logic.

Prerequisites

  • Node.js 18 or later — the SDK uses native fetch and AbortSignal.timeout, both available from Node 18.
  • An API key from the LintLiot dashboard. You generate one when you create an app.

Install the package

npm install @lintliot/sdk

Initialize your project

After installing the package, run the init command from your project root:
npx lintliot init
The init command detects your framework automatically, creates a lintliot.config.ts configuration file, and inserts the middleware into the right place for your framework. For Next.js it writes middleware.ts at the project root. For Express, Fastify, and Koa it adds the app.use or register call before your routes.
You need your API key ready before running npx lintliot init. The command will prompt for it and write it to your .env file as LINTLIOT_API_KEY.

Available adapters

The SDK ships separate entry points for each supported framework. Import from the path that matches your stack:
FrameworkImport pathGuide
Next.js (App Router)@lintliot/sdk/nextLintLiot for Next.js
Express@lintliot/sdk/expressLintLiot for Express
Fastify@lintliot/sdk/fastifyLintLiot for Fastify
Koa@lintliot/sdk/koaLintLiot for Koa
React (client-side gating)@lintliot/sdk/react
Edge (Cloudflare Workers, Deno Deploy)@lintliot/sdk/edge
Supabase@lintliot/sdk/supabase
Vite@lintliot/sdk/vite
If your stack is not listed, you can use createLintliot from @lintliot/sdk directly and call lintliot.protect() as middleware. The client is compatible with any framework that uses the standard Node.js (req, res, next) middleware signature.

Set your API key

Add your API key to your environment. If you use a .env file:
.env
LINTLIOT_API_KEY=lintliot_your_key_here
Then reference it in your SDK configuration:
import { createLintliot } from '@lintliot/sdk'

const lintliot = createLintliot({
  apiKey: process.env.LINTLIOT_API_KEY!,
})
Never commit your API key to source control. Add .env to your .gitignore file.

Next steps

Choose the guide for your framework to see the full integration: Once the SDK is connected, your dashboard will show “Waiting for first request…” and update live when traffic arrives. After seven days, LintLiot completes its learning phase and you can enable enforcement mode with one button.