Start here

Official SDKs

Integrate Lyra from Python, Node.js or Rust with consistent authentication, errors and resource helpers.

Choose your client

The official clients share the same defaults: Bot authentication, a 15-second timeout, standard Lyra errors and support for self-hosted nodes. Resource helpers cover users, communities, channels, messages and webhooks; a generic request method exposes the rest of the API.

LanguagePackageRuntime
Pythonlyra-sdkPython 3.9+
Node.js / TypeScript@lyra-social/sdkNode.js 18+
Rustlyra-sdkAsync with Tokio

Python

Install with pip, create a bot client and use the typed resource helpers. The Python client is synchronous and has no runtime dependency.

python
import os
from lyra import LyraClient

lyra = LyraClient.bot(os.environ["LYRA_BOT_TOKEN"])
me = lyra.users.me()
message = lyra.channels.send(os.environ["LYRA_CHANNEL_ID"], "Hello from Python!")
print(me["username"], message["id"])

Node.js and TypeScript

The Node.js client uses the built-in Fetch API and ships TypeScript declarations. Resource methods return typed objects while preserving fields added by newer Lyra nodes.

typescript
import { LyraClient } from '@lyra-social/sdk'

const lyra = LyraClient.bot(process.env.LYRA_BOT_TOKEN!)
const me = await lyra.users.me()
const message = await lyra.channels.send(
  process.env.LYRA_CHANNEL_ID!,
  'Hello from Node.js!',
)
console.log(me.username, message.id)

Rust

The Rust client is asynchronous, uses rustls for HTTPS and keeps unknown response fields so applications remain forward-compatible.

rust
use lyra_sdk::LyraClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let lyra = LyraClient::bot(std::env::var("LYRA_BOT_TOKEN")?)?;
    let me = lyra.me().await?;
    let message = lyra.send_message(
        &std::env::var("LYRA_CHANNEL_ID")?,
        "Hello from Rust!",
    ).await?;
    println!("{} {}", me.username, message.id);
    Ok(())
}

Self-hosted nodes and raw requests

Set baseUrl (Node.js), base_url (Python) or use the Rust builder to target another node. Always include /api/v1. Use request() for a supported endpoint that does not yet have a dedicated helper. Webhook execution deliberately omits the client Authorization header so bot credentials are never sent to a webhook-token route.

Package availability

The SDK sources and tests live in the Lyra repository under sdks/. Registry publication can be automated independently for npm, PyPI and crates.io.