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 SDKnpm install @lumopilot/sdk@beta2
Connect an account and create a keyUse 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 accountsSave 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.