The SDK is generated automatically from the LineBundle OpenAPI spec on every release, so types and methods are always in sync with the latest API.
Requirements
- Node.js 18+ (or any runtime with the native
fetchAPI) - ESM project — the package is
"type": "module". CommonJS projects can load it with a dynamicawait import('@linebundle-sdk/ts').
Installation
Authentication
The SDK authenticates using an API credential you generate directly inside the LineBundle Studio. No OAuth flows, no client secrets — just a token tied to your organization.Get your API credential
- Log in to LineBundle Studio
- Open your organization → Settings → API Credentials
- Click New Credential, give it a name, and copy the token (
sk_lb_...) - Copy your Organization ID from the same settings page
Set environment variables
Initialize the SDK
https://api.linebundle.com — nothing else to configure.
Credential permissions
The credential inherits the permissions of the user who created it, scoped to the organization. If a request returns403, check that the credential’s associated user has the appropriate role for the operation.
Environments
Staging and production credentials are separate — generate a credential in each environment’s Studio.
To target staging, pass
baseUrl:
Quick Start
Response Pattern
Every SDK method returns{ data, error, response }. HTTP errors never throw — they are captured in error. Always check error before reading data.
Network-level failures (DNS, timeout, connection refused) still throw a regular
Error. Wrap calls in try/catch if you need to handle both HTTP errors and network failures.Error Handling
Useresponse.status to branch on specific HTTP status codes:
Parameters
Parameters are structured by their location in the HTTP request:
All parameter names are snake_case, matching the API exactly. Pagination uses
page (1-based) and size. Sorting uses sort_by and sort_dir ('asc' / 'desc').
TypeScript Types
All request and response types are generated from the API schema and exported from the package:Common Patterns
Paginate through all events
Get spaces linked to an event
Scoped client for server functions
When running server-side (e.g. TanStack Start, Next.js Server Actions), create a newlb instance per request so concurrent calls don’t share state:
Browse the SDK Reference
The full method reference is auto-generated and available in the sidebar, grouped by resource:Events
List, create, update, publish, archive, and version events
Spaces
Manage spaces, members, roles, and documents
Users & Orgs
Users, organizations, roles, and permissions
AI Agent
AI assistant sessions and cost tracking
Automation
Automation rules, triggers, cron jobs, and metadata
Messaging
Chat rooms, messages, and real-time channels
Analytics
Usage analytics and audit logs
Bookings
Event attendance, bookings, and waitlists
Contacts
Contact management within spaces
Integrations
Third-party integration connections