Skip to content
PluginStats

@gnldev/auth weekly downloads statistics

By gnldev (15 listings) · npm · AI SDKs

Auth contract (AuthProvider) + free role-based default (bearer/basic, read/write). Open-core seam: @gnldev/auth-ee plugs into the same interface.

View on npm Outdated · Nov 5, 2026

@gnldev/auth has 30 recorded weekly downloads on npm, a decrease of 89.8% over the past 30 days, ranking #2899 of 3,247 tracked listings.

Weekly downloads
30
Official API · Dec 5, 2026
7-day growth
-52.4%
-33 weekly downloads
30-day growth
-89.8%
-265 weekly downloads
90-day growth
—
Insufficient history
Rank
#2899
▼ 321 in 7 days

About @gnldev/auth

@gnldev/auth

Part of GNL, a full agent framework for TypeScript — works with the rest of it, or on its own.

The auth contract the rest of the framework speaks, plus a role-based default you can use as-is.

Auth is opt-in: leave it out and the REST API and Studio stay open (fine for local work). Wire a provider in and every route is gated. In production, a missing provider is an error rather than a silent open door.

Install

Install: pnpm add @gnldev/auth — or use it from a repo clone: pnpm install && pnpm -r build.

npm i @gnldev/auth

Four credential classes

Pick the class by who holds the token, not by how much it needs to do. Credentials can be a bearer token or a user/password pair for basic auth — comparison is constant-time.

ClassWho holds itOrganizationCan
superAdminyou, running the platformnone, by designeverything, across every organization
admina customer's operatorboundmanage that organization: Studio, budgets, users, workflows
clienta customer's backend serverboundrun agents, cancel runs, read — nothing else
viewera read-only operatorboundread
import { roleAuth } from '@gnldev/auth';
import { createRestApi } from '@gnldev/server';

const auth = roleAuth({
  // The credential your APPLICATION carries. It serves many end users under one token, so every
  // request names the end user it acts for (see below).
  client: { token: process.env.GNL_CLIENT_TOKEN, orgId: 'acme' },
  // The credential a PERSON carries, for Studio.
  admin: { token: process.env.GNL_ADMIN_TOKEN, orgId: 'acme' },
});

const app = createRestApi(config, { auth });

roleAuth returns undefined when no class is configured — that is what keeps auth opt-in.

Give your application client, not admin

admin is an operator credential: it cancels runs, edits budgets, manages users and reads the whole organization's history. An application that only needs to run an agent has no business holding that, and if it leaks, none of those are things you wanted a leaked key to reach.

client is a whitelist — agents:run, workflow:run, run:cancel, plus reads. Anything else is refused, including routes added in later versions. That is the direction you want the default to fail.

A client names the end user it acts for

One application credential serves many end users, so the request says which one:

const GNL = process.env.GNL_URL!;
const CLIENT_TOKEN = process.env.GNL_CLIENT_TOKEN!;

await fetch(`${GNL}/agents/support/run`, {
  method: 'POST',
  headers: { authorization: `Bearer ${CLIENT_TOKEN}`, 'content-type': 'application/json' },
  body: JSON.stringify({
    runId: 'r-882',
    prompt: 'where is my order',
    threadId: 't-ayse-1',
    resourceId: 'u-ayse',   // ← WHOSE request this is
  }),
});

resourceId is what separates one end user's conversation, memory and runs from another's. A client request that omits it is refused (400) rather than served unscoped — without a subject there is nothing to keep two of your users apart. Operator classes may omit it: they work across the organization by design.

You can then ask for one user's data, and have ownership checked:

GET /runs?resourceId=u-ayse             → only that user's runs
GET /threads?resourceId=u-ayse          → only that user's conversations
GET /runs/r-882?resourceId=u-mehmet     → 403, the run belongs to someone else

Keep the client token on your server. It is trusted to say who it acts for, so anyone holding it can claim any resourceId. That is safe in your backend, where you already know who your user is. It is not safe in a browser or a mobile app — ship neither the token nor a proxy that forwards a caller-supplied resourceId unchecked. To let a browser call GNL directly, give it an end-user token instead (next section).

An end user can carry its own token

When your user logs in, your backend signs a short-lived token for that one user. The browser or app calls GNL with it. The holder is that user and nobody else:

import { roleAuth, signSubjectToken } from '@gnldev/auth';

// In GNL's config:
const auth = roleAuth({
  endUsers: { secret: process.env.GNL_END_USER_SECRET!, orgId: 'acme' },
});

// In your backend, after YOUR login succeeds:
const token = signSubjectToken({ sub: 'u-ayse' }, process.env.GNL_END_USER_SECRET!, { ttlSec: 900 });

Only sub is read. The holder is always a subject, with the organization from orgId above. A kind, roles or orgId claim in the token is ignored, so a token cannot make its holder staff or move it to another organization. Writes are the same whitelist as client.

A token signed with a different key, an expired one, or one without sub is nobody (401). Tokens last 15 minutes by default. Use publicKey instead of secret if you sign with RS256 or Ed25519, and issuer/audience to pin those claims.

Rules a token must meet. The secret is at least 32 bytes; a shorter one is a startup error. The sub follows the same rules as a resourceId (1–200 characters, no control characters) and may not start with operator:, application:, role: or token:, which name staff and synthetic ids.

How long a token may live. At most 1 hour (maxTtlSec, default 3600). A token claiming a later exp is refused. If you can take tokens back, pass isRevoked and you may allow up to 30 days: for a credential pasted into an MCP client's config, or a link in an email.

import { roleAuth } from '@gnldev/auth';

const loggedOut = new Set<string>(); // your store: a jti deny-list (at logout: add sessionTokenId(sid)), or a per-user logout time…

Description from the npm listing.

  • ai
  • agent
  • llm
  • typescript
  • ai-sdk
  • durable
  • exactly-once
  • authentication
  • rbac
  • api-keys

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@gnldev/auth weekly downloads on npm, last 90 days: 30 weekly downloads as of Dec 5, 2026.@gnldev/authWeekly downloads on npm · Last 90 days30downloads / week02004006008001K1.2KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@gnldev/auth weekly downloads on npm, last 90 days: 30 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

@gnldev/auth weekly downloads growth on npm: -52.4% over 7 days, -89.8% over 30 days, 90-day growth unavailable.@gnldev/authWeekly downloads growth on npm30downloads / week now7-day growth-33 weekly downloads-52.4%30-day growth-265 weekly downloads-89.8%90-day growth+30 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@gnldev/auth weekly downloads growth on npm: -52.4% over 7 days, -89.8% over 30 days, 90-day growth unavailable.

Ranking history

@gnldev/auth npm ranking history: currently #2899 (by weekly downloads).@gnldev/authnpm ranking · by weekly downloads · Last 90 days#2899current rank#1400#1600#1800#2000#2200#2400#2600#2800#3000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 25 observations · Updated Dec 5, 2026pluginstats.com
@gnldev/auth npm ranking history: currently #2899 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 146, #1 (overall #2,901)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 19, #14 (overall #374)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for @gnldev/auth
Date (UTC)Weekly downloadsChange vs. previous
30-4
340
34-26
60-5
65-7
72-7
79+16
63-5
68-4
72+16
560
56-8
64-22
86—

Similar npm AI SDKs plugins

All 20 @gnldev/auth alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@gnldev/auth. First seen Oct 16, 2026; last successful collection Nov 5, 2026. See the methodology.