Sign JWTs from Functions without managing private keys
Vercel KMS enables signing JWTs and messages from Vercel Functions using managed asymmetric keys, keeping private keys secure in the key management service instead of code or environment variables. Public keys are published via standard OIDC discovery and JWKS endpoints for verification anywhere.
Vercel KMS lets you sign JWTs and arbitrary messages from your Vercel Functions using managed asymmetric signing keys, so private keys never live in your code or environment variables. Your function authenticates with its token, and the private key stays inside Vercel's key management service while verifiers use only the public key.Vercel OIDC
With Vercel KMS you can:
Sign a token inside a function:
Verify a token anywhere with a standard JOSE library, using the issuer's public JWKS:
Set up an issuer and grant a project access from the CLI:
As a best practice, create a separate issuer per project and environment. Isolating issuers keeps each token audience distinct, scopes signing access to exactly one project and environment, and lets you rotate or revoke keys for one without affecting the others.
To get started, or open Key Management in your team's dashboard. read the docs
Create and rotate issuers and signing keys (RSA, ECDSA, and EdDSA) from the CLI and dashboard.
Sign JWTs with custom claims and a configurable TTL, or sign raw bytes, using the package.
@vercel/kmsGrant a project signing access per environment, including production, preview, development, and custom environments.
Constrain the claims a project can request per grant, and validate token claims against a JSON Schema.
Verify signed tokens anywhere. Each issuer publishes a public document at and a JWK set at , so any standard OIDC or JOSE library can validate tokens without Vercel-specific code.OpenID Connect Discovery
https://kms.vercel.com/<issuerId>/.well-known/openid-configurationhttps://kms.vercel.com/<issuerId>/jwks.json
Source: original entry ↗