vercel library

Vercel Fetch and Node.js adapters for Routed applications.

Use the Fetch entrypoints for Vercel Edge-style handlers and the Node entrypoints when Vercel captures a native Node.js server handler.

Classes

FetchRequestView
Host-neutral view of a Fetch-style request.
FetchResponseView
Host-neutral response value produced for Fetch-style hosts.
FetchWebSocketUpgrade
Defines the public contract for this host integration.
NodeIncomingView
Node http.IncomingMessage surface used by NodeRequestAdapter.
NodeRoutedWebSocket
WebSocket implementation for a raw Node upgrade socket.
NodeServerResponseView
Defines the public contract for this host integration.
NodeWebSocketSocketView
Node http.ServerResponse surface used by NodeResponseAdapter. Raw upgraded Node socket used by the Node WebSocket adapter.
NodeWebSocketUpgradeResponse
Native handshake information for a Node upgrade.
RoutedNodeCapabilities
Capabilities declared by one host invocation.
RoutedNodeContext
Runtime-scoped host context carried through a Routed request.
RoutedNodeExtension
A typed lookup for host-owned request context values.
RoutedNodeLifecycleEvent
Host lifecycle event published through Routed's existing EventManager.
RoutedNodeRuntimeInfo
Common runtime metadata exposed by a host adapter.
VercelNodeRuntimeExtension
Host-native Vercel Node.js request, response, and server handles.
VercelRequestProperties
Vercel request metadata exposed by the platform's x-vercel-* headers.

Enums

RoutedNodeEntryModel
Whether a host owns a long-lived listener or invokes a fetch export.
RoutedNodeLifecyclePhase
Lifecycle phases emitted by a routed_node host.
RoutedNodeRuntime
Runtime families supported by routed_node.

Extensions

RoutedVercelRequest on Request
Returns Vercel metadata for a request handled by the Vercel Fetch entry.

Constants

vercelCapabilities → const RoutedNodeCapabilities
Capabilities advertised by the Vercel Fetch adapter.
vercelNodeCapabilities → const RoutedNodeCapabilities
Vercel Node Functions use the vendor's request-context upgrade boundary and the ws server implementation for native WebSocket connections.

Functions

defineFetchExport(String runtime, Engine engine, {required RoutedNodeCapabilities capabilities, String name = '__routed_fetch__'}) → Never
VM stub for JavaScript Fetch exports.
defineFetchExportAsync(String runtime, Future<Engine> engineFuture, {required RoutedNodeCapabilities capabilities, String name = '__routed_fetch__'}) → Never
VM stub for asynchronous JavaScript Fetch exports.
defineFetchExportFactoryAsync(String runtime, Future<Engine> engineFactory(), {required RoutedNodeCapabilities capabilities, String name = '__routed_fetch__'}) → Never
VM stub for lazy asynchronous JavaScript Fetch exports.
defineVercelFetch(Object engine) → void
Installs the Vercel Fetch bootstrap function.
defineVercelFetchAsync(Future<Engine> engine) → void
Installs a Vercel Fetch export from an asynchronously-built engine.
defineVercelFetchFactoryAsync(Future<Engine> factory()) → void
Installs a Vercel Fetch entry whose engine is created lazily on request.
defineVercelNodeHandler(Engine engine) → void
Installs a Vercel Node.js server entrypoint with native WebSocket upgrades.
defineVercelNodeHandlerFactory(Future<Engine> factory()) → void
Installs a Vercel Node.js handler with lazy engine initialization.
dispatchFetchConnection(Engine engine, FetchRequestView request, ResponseAdapter response, {required RoutedNodeRuntimeInfo runtime, Uri? baseUri, Future<FetchWebSocketUpgrade> acceptWebSocket()?}) Future<void>
Dispatches a Fetch-style request through the streaming adapter path.
dispatchFetchExchange(Engine engine, FetchRequestView request, {required RoutedNodeRuntimeInfo runtime, Uri? baseUri}) Future<FetchResponseView>
Dispatches a Fetch-style request through Routed's buffered portable path.
portableRequestFromFetch(FetchRequestView request, {Uri? baseUri}) → PortableRequest
Converts a Fetch-style request into the core portable request contract.
publishRoutedNodeLifecycle(Engine engine, RoutedNodeLifecycleEvent event) → void
Publishes a host lifecycle event when the engine has an EventManager.