Command Palette

Search for a command to run...

Quickstart

The Pylo Node SDK (@pylo/node) gives you type-safe server-side access to your Pylo data with API key authentication — for backends, scripts, and internal tools.

Install

$pnpm add @pylo/node

Environment

.env
1 PYLO_API_KEY=your-api-token-here

Create an API token in Settings > API Tokens in your Pylo admin panel. See API Tokens for details.

Generate Types

Create a config file and run the codegen CLI to generate TypeScript types from your Pylo schema.

pylo.config.ts
1 2 3 4 5 6 import { defineConfig } from '@pylo/node/codegen'; export default defineConfig({ apiKey: process.env.PYLO_API_KEY!, folder: '.pylo', // optional, defaults to '.pylo' });
$npx pylo generate

This creates a .pylo/ directory with your generated types and schema metadata.

When to regenerate

Run npx pylo generate whenever you add, remove, or modify entities or fields in Pylo.

Create Client

lib/pylo.ts
1 2 3 4 5 6 7 8 import { createPyloNode } from '@pylo/node'; import type { PyloSchema } from '../.pylo'; import { schemaMetadata } from '../.pylo/schema-metadata'; export const pylo = createPyloNode<PyloSchema>({ apiKey: process.env.PYLO_API_KEY!, schemaMetadata, });

You're ready to go. Head to Querying Data to start fetching data.