@glinr/theauth-nuxt

Nuxt adapter for TheAuth - exposes agent auth as HTTP REST endpoints via H3
953 20
Install
npm install @glinr/theauth-nuxt
Latest Version:5.1.0
Vue:3
License:MIT
Last Updated:Oct 21, 2026
Links: GitHub  ·  npm
Maintainer: gdsks

@glinr/theauth-nuxt

npm · Source · Docs · All packages

Nuxt adapter for theAuth.

npm

Part of theAuth, open-source auth for AI agents and humans. Docs: docs.theauth.dev.

Install

pnpm add @glinr/theauth @glinr/theauth-nuxt

Usage

Create server/api/theauth/[...].ts:

import { createTheAuth } from '@glinr/theauth';
import { theAuthNuxt } from '@glinr/theauth-nuxt';

const theauth = createTheAuth({
  database: { provider: 'sqlite', url: 'theauth.db' },
});

export default theAuthNuxt(theauth, { authenticate });

This handles the full theAuth REST API under /api/theauth: agent CRUD, authorization, delegations, audit logs, and dashboard stats.

With MCP OAuth 2.1

import { createMcpModule } from '@glinr/theauth/mcp';
import { theAuthNuxt } from '@glinr/theauth-nuxt';

const mcp = createMcpModule({
  issuer: 'https://your-app.com',
  // ...
});

export default theAuthNuxt(theauth, { mcp, authenticate });

When mcp is provided, the OAuth 2.1 endpoints are enabled:

  • GET /.well-known/oauth-authorization-server
  • GET /.well-known/oauth-protected-resource
  • POST /mcp/register
  • GET /mcp/authorize
  • POST /mcp/token

Management routes and client IP

With the default session guard, a signed-in user only acts on their own agents, delegations and audit rows. A custom authenticate resolver is a trust decision and sees everything.

The adapter does not read forwarded headers for the client IP. Behind a proxy, set trustedProxy with trustedProxyCount or trustedHeader, or ipAllowlist constraints cannot match.

export default theAuthNuxt(theauth, { authenticate, trustedProxy: { trustedProxyCount: 1 } });

On Cloudflare use trustedHeader: "cf-connecting-ip". Only trust a header your edge overwrites.

API surface

theAuthNuxt(theauth, options?) returns an H3 EventHandler for use as a Nuxt server route.

Option Type Description
mcp McpAuthModule Enables MCP OAuth 2.1 endpoints
basePath string URL prefix before the catch-all segment. Defaults to /api/theauth

For full docs on agent identity, permissions, delegation, and audit, see the main @glinr/theauth package.

Links

License

MIT

Learn more

Related Packages

@kavachos/nuxt

Nuxt adapter for KavachOS - exposes agent auth as HTTP REST endpoints via H3

1,365 20
nuxt-mcp-dev

MCP server from your Nuxt dev server helping models to understand your Nuxt app...

97,799 911
h3-express

Express polyfill for h3

5,877 7

Version History

Version Released Vue License
5.1.0 ^3.0 MIT
5.0.1 ^3.0 MIT
5.0.0 ^3.0 MIT
4.0.0 ^3.0 MIT
3.0.3 ^3.0 MIT