@vercel/oidc
Runtime OIDC helpers intended for use with Vercel Functions
Last updated 8 months ago by vercel-release-bot .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @vercel/oidc 
SYNC missed versions from official npm registry.

@vercel/oidc

Runtime OIDC helper methods intended to be used with your Vercel Functions

Usage

Getting an OIDC Token

import { getVercelOidcToken } from '@vercel/oidc';

// Get token using project.json configuration
const token = await getVercelOidcToken();

// Get token with explicit project and team (supports both IDs and slugs)
const token = await getVercelOidcToken({
  project: 'my-project', // or 'prj_abc123'
  team: 'my-team', // or 'team_xyz789'
});

// Get token with expiration buffer (refresh if expires within 5 minutes)
const token = await getVercelOidcToken({
  expirationBufferMs: 5 * 60 * 1000,
});

API

getVercelOidcToken(options?)

Gets the current OIDC token from the request context or environment variable. Will refresh the token if expired in development.

Options:

  • project?: string - Project ID (prj_*) or slug
  • team?: string - Team ID (team_*) or slug
  • expirationBufferMs?: number - Buffer time in ms before expiry to trigger refresh (default: 0)

getVercelOidcTokenSync()

Synchronously gets the current OIDC token without refreshing. Use getVercelOidcToken() if you need automatic refresh in development.

Current Tags

  • 3.2.0                                ...           canary (2 months ago)
  • 3.2.0                                ...           latest (2 months ago)

12 Versions

  • 3.3.0-canary.20260211174907.cdd2da6                                ...           2 months ago
  • 3.2.0                                ...           2 months ago
  • 3.1.0                                ...           3 months ago
  • 3.0.5                                ...           5 months ago
  • 3.0.4                                ...           5 months ago
  • 3.0.3                                ...           6 months ago
  • 3.0.2                                ...           6 months ago
  • 3.0.1                                ...           6 months ago
  • 3.0.0                                ...           7 months ago
  • 2.0.2                                ...           8 months ago
  • 2.0.1                                ...           8 months ago
  • 2.0.0                                ...           9 months ago
Downloads
Today 0
This Week 2
This Month 7
Last Day 1
Last Week 6
Last Month 1
Dependencies (2)
Dev Dependencies (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |