JavaScript SDK
Use the JavaScript SDK to automate workspace workflows from Node.js and TypeScript with generated clients and types.
Package
Use the @onehorizon/sdk-js package when you want generated clients and TypeScript types for API calls.
Install it in a Node.js or TypeScript project:
npm i @onehorizon/sdk-js@latestThe SDK accepts either a workspace API key or an OAuth access token. Use API Keys for trusted server-side jobs. Use OAuth when your app adds Log in with One Horizon or Connect One Horizon and needs user-approved workspace access.
import { Configuration, DocumentsApi } from '@onehorizon/sdk-js' const config = new Configuration({ accessToken: process.env.ONE_API_KEY })const documents = new DocumentsApi(config)
Common uses
- List and update initiatives, bugs, tasks, and comments.
- Fetch workspace members, teams, and taxonomy.
- List and fetch documents.
- Handle typed webhook events.
- Build backend jobs, CI automation, or integration services.
Webhook receivers can use generated event types to parse CloudEvents payloads and then fetch more context with API clients when the event only includes the changed resource.
Pair with the right auth
Use API Keys for backend services and CI/CD jobs that act on a workspace. Use OAuth when users need to approve access from their own One Horizon account.
The SDK follows the same model as the REST API and can handle events from Webhooks. If you are building an agent, use the agent workflow pages for the model and the API reference for exact schemas.