Installation and setup

Install the Publiq SDK for Node.js, Python or PHP, create your API key and validate the setup with a first call.

1. Install the SDK

The official SDKs are the recommended way to use Publiq — they bring types, automatic retries and idempotency. Install for your language:

npm install publiq
pnpm add publiq
yarn add publiq
pip install publiq
composer require publiq/publiq

2. Create your API key

In the dashboard, go to Settings → API Keys and generate a key. Keys have a scope (full or read-only) — use full to send. Store it securely: it is shown only once.

3. Configure the environment

The SDK reads the PUBLIQ_API_KEY environment variable automatically. Set it in your server environment (.env, provider secrets, etc.):

PUBLIQ_API_KEY=pk_live_xxxxxxxxxxxxxxxx

Never expose the API key in the frontend (React, mobile, client-side apps). Always call Publiq from the server — see the Next.js, NestJS and Express guides.

4. Validate the setup

Make a read call to confirm the key works (sends nothing):

import { Publiq } from 'publiq';

const publiq = new Publiq(process.env.PUBLIQ_API_KEY);
const { data } = await publiq.templates.list();
console.log('OK —', data.length, 'templates');
curl https://api.publiq.digital/v1/templates \
  -H "Authorization: Bearer $PUBLIQ_API_KEY"

The Node SDK is written in TypeScript and ships types for every parameter and response — editor autocomplete guides you. Next: Quickstart.

Installation and setup — Publiq Docs