Repository navigation
0.5.0
New optional products for Vercel features, each its own library so apps only link what they use.
See "Optional Vercel features" in the README.
VercelCache: the Vercel Runtime Cache (RuntimeCache), likegetCache()from
@vercel/functionsand sharing entries with it:Codablevalues with TTLs and tags (dates
encoded like Node'sJSON.stringify, customizable withencoder:/decoder:), and an in-memory
fallback locally.VercelGlobalConfig: reads Global Config (formerly Edge Config) stores (GlobalConfig), like
@vercel/edge-config:get,has,getAllanddigest, typed or asGlobalConfigValue.VercelFirewall: rate limiting with Vercel Firewall rules (Firewall.checkRateLimit, returning
aRateLimitResultwith an optionalRateLimitResult.Reason), like@vercel/firewall.VercelOIDC: the request's OIDC token and its claims (OIDC.token(),VercelOIDCToken), token
exchange for other audiences (OIDC.exchange), and AWS credentials from STS
(AWSCredentialsProvider,OIDC.awsCredentials).- Each feature module throws its own error type (
RuntimeCacheError,GlobalConfigError,
VercelFirewallError,VercelOIDCError) withtimedOut,requestFailedand an unexpected
status case. Descriptions,dumpand debug output of credentials, tokens and clients never
show secrets. Vercel: everything above plusVercelRuntime, with oneimport Vercel.VercelRuntime:Vercel.withRequestnow also works locally and setsVercel.currentRequest,
which the feature modules use to find the request's headers.Vercel.deadlineand
request.headers.vercel.deadlinegive the request's deadline.Vercel.reportFetchshows
outbound requests under External APIs in Observability; the feature modules report theirs
automatically.VercelBootstrap: passes the request deadline to the app asx-vercel-deadline(replacing any
sent by a client), forwards fetch metrics, and hands runtime cache configuration that Vercel
hides from request headers to the app over its socket (asked once per request, with a 1 second
timeout). It no longer depends onVercelRuntime, so it stays small.