Skip to main content
Use the SDK when your integration is written in TypeScript or JavaScript and runs on a server.

Install

pnpm add plato-api-sdk
Use the package manager your project already uses:
npm install plato-api-sdk
yarn add plato-api-sdk
bun add plato-api-sdk

Create A Client

import { createPlatoApiClient } from "plato-api-sdk";

export const plato = createPlatoApiClient({
  baseUrl: "https://api.plato.ae",
  apiKey: process.env.PLATO_API_KEY,
});
The SDK accepts either the API origin or the full tRPC endpoint:
createPlatoApiClient({
  baseUrl: "https://api.plato.ae",
  apiKey: process.env.PLATO_API_KEY,
});

createPlatoApiClient({
  baseUrl: "https://api.plato.ae/api/trpc",
  apiKey: process.env.PLATO_API_KEY,
});

First Request

const feed = await plato.v1.orders.externalOrderFeed.query({
  apiKey: process.env.PLATO_API_KEY,
  date: "2026-06-17",
});

console.log(feed.count);
Most SDK API-key routes read the key from the Authorization header created by the SDK. Some routes also keep an apiKey input field for compatibility. When in doubt, pass the key to the SDK client and follow the input examples in each API page.

Disable Batching

The SDK batches requests by default. If an environment or proxy has trouble with batched tRPC requests, disable batching:
const plato = createPlatoApiClient({
  baseUrl: "https://api.plato.ae",
  apiKey: process.env.PLATO_API_KEY,
  batch: false,
});

Custom Headers

Use headers when your environment needs extra request headers.
const plato = createPlatoApiClient({
  baseUrl: "https://api.plato.ae",
  apiKey: process.env.PLATO_API_KEY,
  headers: {
    "x-request-source": "my-integration",
  },
});
The SDK keeps the API key header in place.