JavaScript and TypeScript quickstart

Install the SDK and verify your first API key by listing connected accounts.

The LumoPilot SDK lists connected accounts, uploads media, and schedules or publishes posts from Node.js.

1
Install the SDK
npm install @lumopilot/sdk@beta
2
Connect an account and create a key

Use Node.js 18 or newer and an active paid LumoPilot account. Connect a social account, then generate a key with List connected accounts in Developer settings. Store it in the server-side LUMOPILOT_API_KEY environment variable. Open Developer settings

3
List connected accounts

Save this as accounts.mjs and run node accounts.mjs.

import { LumoPilot, LumoPilotError } from '@lumopilot/sdk';

const apiKey = process.env.LUMOPILOT_API_KEY;
if (!apiKey) {
  console.warn('Set LUMOPILOT_API_KEY first.');
} else {
  try {
    const client = new LumoPilot({ apiKey });
    const accounts = await client.accounts.list();
    console.log(accounts);
  } catch (error) {
    const status = error instanceof LumoPilotError ? error.status : undefined;
    console.warn('Could not list accounts.', { status });
  }
}

If you see an empty array, connect a social account and try again.

Upload a file and schedule a post

Use a local image and attach it to your first scheduled post.

Try the dummy playground

Explore SDK responses with sample data.