theAuth for TypeScript: sign-in, agent identity and an MCP authorization server

One MIT package for people signing in and for agents and MCP clients calling your API. It runs on Node, Bun, Deno and Cloudflare Workers. The core package is @glinr/theauth 1.2.0.

pnpm add @glinr/theauth sql.js

npm users: npm install @glinr/theauth sql.js. The SQLite driver is a peer dependency.

Send a magic link in about ten lines.

Run against @glinr/theauth 1.2.0 with sql.js on 2026-10-31. The sign-in link prints to the terminal, so no mail provider is needed to try it.

auth.ts
import { createTheAuth } from "@glinr/theauth";

const theauth = await createTheAuth({
  database: { provider: "sqlite", url: "app.db" },
  baseUrl: "http://localhost:3000",
  auth: { session: { secret: process.env.SESSION_SECRET! } }, // 32+ characters
  magicLink: {
    appUrl: "http://localhost:3000",
    sendMagicLink: async (email, _token, url) => {
      console.log(`sign-in link for ${email}: ${url}`);
    },
  },
});

await theauth.magicLink?.sendLink("[email protected]");

Mount it behind Hono, Express, Next.js and others with the adapters below. The get started page covers the agent track, and the Hono guide runs both tracks in one app.

What is stable and what is not.

The core, client, MCP and CLI packages are on the 1.x line and follow semantic versioning: a breaking change ships only in a major release. Many adapter, UI and tooling packages are still below 1.0 and can change in a minor release. Both rules come from the repository's STABILITY.md, summarized on the stability page.

Packages are published to npm from GitHub Actions with a provenance attestation, per the public publish workflow. Release process: releases page. We do not claim a third-party audit or certification.

Core version
1.2.0
License
MIT
Runtimes
Node, Bun, Deno, Workers
Runtime deps (core)
drizzle-orm, jose, zod

Versions from npm, read 2026-10-31.

Pick the packages you need.

All packages are published under the @glinr scope. Framework adapters (Next.js, SvelteKit, Nuxt, Hono, Express, Fastify, Astro, NestJS) are listed with install commands in the SDK explorer.

Core TypeScript packages and what they are for
PackageWhat it is for
@glinr/theauthCore: agents, auth, MCP authorization server.
@glinr/theauth-clientBrowser and Node client.
@glinr/theauth-reactReact hooks and components.
@glinr/theauth-cliCommand line tool, including theauth doctor.
@glinr/create-theauth-appProject scaffolder: pnpm create @glinr/theauth-app.

Get started

Give your first agent an identity.

Install the package, create an agent with scoped permissions, and read its first audit record. The core runs on Postgres, SQLite, MySQL or D1, and the Go module needs a single go get.

  • npm install @glinr/theauth
  • go get github.com/glincker/theauth-go/v2
Or skip hosting with theAuth Cloud