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.jsnpm 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.
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.
| Package | What it is for |
|---|---|
| @glinr/theauth | Core: agents, auth, MCP authorization server. |
| @glinr/theauth-client | Browser and Node client. |
| @glinr/theauth-react | React hooks and components. |
| @glinr/theauth-cli | Command line tool, including theauth doctor. |
| @glinr/create-theauth-app | Project 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/theauthgo get github.com/glincker/theauth-go/v2