> ## Documentation Index
> Fetch the complete documentation index at: https://docs.signa.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Calling the API from Edge Runtimes

> Use the Signa API from Cloudflare Workers, Deno Deploy, and Vercel Edge Functions

The Signa API works from edge runtimes such as Cloudflare Workers, Deno Deploy, and Vercel Edge Functions with no special configuration. This page covers the few things worth knowing.

## User-Agent is optional

Some edge runtimes send requests without a `User-Agent` header, and some strip or normalize it. Since 2026-08-27, the API accepts requests with a missing or empty `User-Agent`: they are counted for observability but never blocked solely because the `User-Agent` is missing or empty.

We still recommend setting one that identifies your integration, in the `vendor-product/version` style:

```
User-Agent: brandx-labs-core/1.0
```

A stable, recognizable value lets support trace your traffic quickly when you report an issue. The [TypeScript SDK](/sdk/typescript) sets an identifying `User-Agent` automatically, so if you use the SDK there is nothing to do.

## Keep API keys in the platform secret store

Edge bundles are deployed artifacts. Never embed `sig_` keys in bundled code or public environment configuration; put them in the platform's secret store and read them at runtime:

* **Cloudflare Workers:** `wrangler secret put SIGNA_API_KEY`, then read `env.SIGNA_API_KEY`
* **Deno Deploy:** project environment variables, read via `Deno.env.get("SIGNA_API_KEY")`
* **Vercel Edge Functions:** encrypted environment variables, read via `process.env.SIGNA_API_KEY`

## Errors are JSON, including edge-generated ones

Nearly every error response follows the standard [error envelope](/api-reference/errors), including responses generated at the edge before your request reaches the API (security blocks, oversized payloads, rate limits). A few narrow exceptions return HTML instead: oversized URIs (414), and oversized or malformed request headers (400 from the load balancer, or 494 when they exceed the CDN's larger header cap), documented in the [error catalog](/api-reference/errors#edge-generated-errors). So check the `Content-Type` header before parsing:

```typescript theme={null}
const res = await fetch("https://api.signa.so/v1/trademarks?q=acme&limit=5", {
  headers: {
    Authorization: `Bearer ${env.SIGNA_API_KEY}`,
    "User-Agent": "brandx-labs-core/1.0",
  },
});

if (!res.ok) {
  if (res.headers.get("content-type")?.includes("application/json")) {
    const { error, request_id } = await res.json();
    console.error(`Signa API error ${error.status} (${error.type}): ${error.detail} [${request_id}]`);
  } else {
    // 414/400/494 rejected before the API; correlate via x-amz-cf-id
    console.error(`Edge error ${res.status} [${res.headers.get("x-amz-cf-id")}]`);
  }
}
```
