---
title: "@glinr/theauth: TypeScript auth library"
description: "The @glinr/theauth npm package: MIT, Node, Bun, Deno and Workers. Install, a verified sign-in snippet, package list, stability and links."
canonical: https://theauth.dev/typescript/
lastmod: 2026-10-31
---

# 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.

[TypeScript quickstart](https://docs.theauth.dev/quickstart) [Secure an MCP server](https://theauth.dev/guides/mcp-server-typescript/)

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

```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("ada@example.com");
```

Mount it behind Hono, Express, Next.js and others with the adapters below. The [get started page](https://theauth.dev/get-started/) covers the agent track, and the [Hono guide](https://theauth.dev/guides/hono-human-and-agent-auth/) 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](https://github.com/glincker/theauth/blob/main/STABILITY.md), summarized on the [stability page](https://theauth.dev/open/stability/).

Packages are published to npm from GitHub Actions with a provenance attestation, per the public [publish workflow](https://github.com/glincker/theauth/blob/main/.github/workflows/publish.yml). Release process: [releases page](https://theauth.dev/open/releases/). We do not claim a third-party audit or certification.

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](https://theauth.dev/#sdks).

Core TypeScript packages and what they are for

| Package | What it is for |
| --- | --- |
| [@glinr/theauth](https://www.npmjs.com/package/@glinr/theauth) | Core: agents, auth, MCP authorization server. |
| [@glinr/theauth-client](https://www.npmjs.com/package/@glinr/theauth-client) | Browser and Node client. |
| [@glinr/theauth-react](https://www.npmjs.com/package/@glinr/theauth-react) | React hooks and components. |
| [@glinr/theauth-cli](https://www.npmjs.com/package/@glinr/theauth-cli) | Command line tool, including theauth doctor. |
| [@glinr/create-theauth-app](https://www.npmjs.com/package/@glinr/create-theauth-app) | Project scaffolder: pnpm create @glinr/theauth-app. |

## Where to find it

- [Source on GitHub: glincker/theauth](https://github.com/glincker/theauth)
- [npm: @glinr/theauth](https://www.npmjs.com/package/@glinr/theauth)
- [Documentation](https://docs.theauth.dev)
- [TypeScript examples](https://theauth.dev/examples/#typescript)
- [Issues and discussions](https://github.com/glincker/theauth/issues)
- [Using Go instead? theauth-go](https://theauth.dev/go/)
- [Feature status in TypeScript and Go](https://theauth.dev/features/)
- [When another tool fits better](https://theauth.dev/when-not-to-use/)
