---
title: JavaScript and TypeScript quickstart
description: Install the SDK and verify your first API key by listing connected accounts.
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://dev.lumopilot.com/llms.txt). Append `.md` to any page URL for its markdown version.

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

## 1. Install the SDK

```bash
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](https://app.lumopilot.com/settings?tab=developer)

## 3. List connected accounts

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

```js
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.

<Card title="Upload a file and schedule a post" href="/upload-media">
Use a local image and attach it to your first scheduled post.
</Card>

<Card title="Try the dummy playground" href="/playground">
Explore SDK responses with sample data.
</Card>
