Programming API
Programmable API
Use the Zuplo runtime APIs in your custom handlers and policies to work with requests, responses, cached data, and gateway services. This index groups the references by what you need to do.
Requests and responses
These APIs provide request data, execution context, and response helpers:
| API | Purpose |
|---|---|
| ZuploRequest | Access request parameters, query values, and authenticated user data. |
| ZuploContext | Access the request ID, logger, route information, and event hooks. |
| RequestUser | Represent the authenticated caller's identity and data. |
| HttpProblems | Create HTTP problem responses. |
| HttpStatusCode | Reference standard HTTP status codes. |
| ProblemResponseFormatter | Format HTTP problem details. |
| CorsPolicyConfiguration | Configure a custom CORS policy. |
Caching and data
Choose an API for the data you need to store or load:
| API | Purpose |
|---|---|
| ZoneCache | Store key-value data within a zone. |
| MemoryZoneReadThroughCache | Cache values in memory with automatic loading. |
| StreamingZoneCache | Cache streaming responses. |
| ContextData | Store typed context data. |
| BackgroundLoader | Load and cache data in the background. |
| BackgroundDispatcher | Enqueue work for batch processing in the background. |
Runtime extensions and hooks
These APIs extend runtime behavior and handle errors:
| API | Purpose |
|---|---|
| RuntimeExtensions | Register plugins, request and response hooks, and custom error handling. |
| Request/response hooks | Run code at request and response lifecycle events. |
| RuntimeError | Represent a runtime error. |
| ConfigurationError | Represent a configuration error. |
Environment and services
These APIs provide environment values, logging, and platform services:
| API | Purpose |
|---|---|
| environment | Read environment variables. |
| Logger | Write structured log messages. |
| ZuploServices | Create identity tokens with getIDToken to authenticate gateway requests to external services. |
Handlers
A route's handler determines how the gateway responds to a request:
| Handler | Purpose |
|---|---|
awsLambdaHandler | Invoke an AWS Lambda function. |
mcpServerHandler | Expose API operations through MCP. |
openApiSpecHandler | Serve an OpenAPI specification. |
redirectHandler | Return a redirect response. |
urlForwardHandler | Forward requests to a backend. |
urlRewriteHandler | Rewrite the URL used to call a backend. |
webSocketHandler | Handle WebSocket connections. |
| Custom function | Implement a handler in your own code. |
Plugins
For setup instructions, see the logging and metrics guides. These integrations are also available through runtime plugins:
| Plugin | Integration |
|---|---|
AWSLoggingPlugin | AWS CloudWatch logging |
DataDogLoggingPlugin | Datadog logging |
DynaTraceLoggingPlugin | Dynatrace logging |
GoogleCloudLoggingPlugin | Google Cloud Logging |
LokiLoggingPlugin | Grafana Loki logging |
NewRelicLoggingPlugin | New Relic logging |
SplunkLoggingPlugin | Splunk logging |
SumoLogicLoggingPlugin | Sumo Logic logging |
VMWareLogInsightLoggingPlugin | VMware Log Insight logging |
DataDogMetricsPlugin | Datadog metrics |
DynatraceMetricsPlugin | Dynatrace metrics |
NewRelicMetricsPlugin | New Relic metrics |
AzureBlobPlugin | Azure Blob Storage |
AzureEventHubsRequestLoggerPlugin | Azure Event Hubs logging |
HydrolixRequestLoggerPlugin | Hydrolix |
AkamaiApiSecurityPlugin | Akamai API security |
Last modified on