Tenant API-key requests
Every Routeser API call is authenticated with your tenant API key. Store the key as a server secret; never ship it to a browser bundle.
Integration / TypeScript
The published @routeser/client package is the supported TypeScript surface. It reuses Routeser's shared contracts, authenticates with a tenant API key, and exposes bounded async waiters instead of long-held create requests.
Install
Add the client with npm install @routeser/client. It reuses the same request and response schemas the API validates against, so your types match production behavior.
The package is published to npm: @routeser/client on npm.
import { RouteserClient } from "@routeser/client";
const client = new RouteserClient({
apiKey: process.env.ROUTESER_API_KEY!,
baseUrl: process.env.ROUTESER_API_BASE_URL!,
tenantId: "ten_example123"
});
// Presigned regional upload, job creation, bounded wait.
const { result } = await client.extractFile({
file,
idempotencyKey: "invoice-2048",
input: {
fileName: "invoice.pdf",
mediaType: "application/pdf",
sizeBytes: file.size
},
schema: {
version: "1",
fields: [
{ name: "invoice_number", type: "string" },
{ name: "vendor_name", type: "string" },
{ name: "total_due", type: "number" }
]
}
});
Every Routeser API call is authenticated with your tenant API key. Store the key as a server secret; never ship it to a browser bundle.
Upload initiation returns a short-lived regional presigned PUT. The client forwards upload-initiation headers exactly and preserves the object version header so create-job can reference the uploaded bytes.
Create-job returns quickly. The client's waiters poll job status within bounds rather than holding a request open, matching Routeser's asynchronous contract.
Integration path
Questions, answered plainly
The supported TypeScript client is published to npm as @routeser/client and reuses Routeser's shared request and response contracts.
Do not ship a tenant API key to the browser. Call Routeser from a server or trusted backend; browsers may only perform the presigned direct upload.
No. Create-job returns quickly and the client exposes bounded status waiters that poll for the terminal result.
Next step
Open the console to provision a tenant API key and start integrating with the TypeScript client.