npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@authlane/sdk

v0.1.0

Published

TypeScript SDK for Authlane - OAuth connections for AI agents

Readme

@authlane/sdk

Server-side TypeScript client for the Authlane control plane. Authlane stores connection policy, status, tool definitions, and credentials; your SaaS executes provider requests directly.

Install

pnpm add @authlane/sdk

Configure

import { Authlane } from '@authlane/sdk';

const authlane = new Authlane({
  apiKey: process.env.AUTHLANE_API_KEY!,
  baseUrl: 'https://app.authlane.io',
});

The API-key client is server-only. API and adapter operations use { data, error }; expected failures do not throw. Invalid constructor configuration still throws.

Bind an authenticated user

Derive the external user ID from your trusted server session and bind it once:

const currentUser = await requireUser(request);
const user = authlane.user(currentUser.id);

const { data: capabilities, error } = await user.capabilities.get({ format: 'mcp' });
const connections = await user.connections.list();

The capability read returns effective connection states and tool definitions in one versioned hot snapshot. Never accept externalUserId from model or tool input.

Build executable AI tools

Install @authlane/ai and the optional peer for your framework. For Vercel AI SDK:

pnpm add @authlane/ai ai zod
import { vercelAI } from '@authlane/ai/vercel';

const { data: tools, error } = await user.tools.list({ adapter: vercelAI() });

tools is bound to this external user and belongs only in the trusted SaaS runtime. Do not serialize it to a browser or cache it across identities. A fresh, audited, access-only credential lease is created only when a local generated callback executes; the integration consumes it and calls the provider from your process. Provider traffic never flows through Authlane.

See @authlane/ai for Vercel AI SDK, OpenAI Agents, Mastra, local MCP, custom integration, and security examples. Mastra applications import mastraAI from @authlane/ai/mastra and pass it to the same user-scoped tools.list call.

Hosted connect UI

Create a short-lived session on your backend and return only its URL to the browser:

const session = await authlane.connectSessions.create({
  externalUserId: currentUser.id,
  allowedServices: ['github', 'slack'],
  allowedOrigin: 'https://app.example.com',
  expiresInSeconds: 600,
});

Use session.data?.url as a hosted page or pass it to @authlane/react.

Pass allowedServices: [] to snapshot every service currently enabled globally and for your organization. The session stores concrete IDs, not a wildcard. Services enabled later are not added, while services disabled later are hidden and cannot start a new authorization.

Definitions without execution callbacks

await authlane.services.list();
await user.tools.list({ format: 'openai' });

Required API-key scopes

  • catalog:read
  • connections:read
  • credentials:issue
  • connect-sessions:create

Grant only the scopes used by each workload. OAuth refresh and ID tokens never leave Authlane.

License

MIT