Basic usage
Create a fetch function for a specific target:Response with attestation
Every response includes attestation data:Configuration options
HTTP methods
All standard HTTP methods are supported:Request bodies
Multiple body types are supported:Streaming responses
Handle streaming responses with standard Web Streams API:Server-Sent Events (SSE)
Parse SSE streams:Chunked transfer encoding
Chunked encoding is handled automatically:Abort signals
Cancel requests with AbortController:Connection pooling
Connections are automatically pooled and reused:- Idle timeout: 5 minutes
- Keep-alive: Enabled by default
- Overflow connections: Created when pool is busy, closed after use
Default headers
Set default headers for all requests:URL resolution
Multiple URL formats are supported:HTTPS Agent (Node.js)
For libraries that don’t accept custom fetch functions, use the Agent API:Graceful shutdown
Close all connections before process exit:- Server processes with graceful shutdown handlers
- Test suites that need clean teardown
- CLI tools that need clean exit
Error handling
Handle attestation and network errors:Next steps
- Custom Policies - Configure verification rules
- AI SDK Integration - Use with AI SDK providers
- Policy Configuration - Full policy reference