JavaScript SDK
The JavaScript SDK is the typed client for the REST API: generated API clients, TypeScript models, bearer-token auth through Configuration.accessToken, and webhook event types. The package has no harness dependencies.
Read the SDK docs
Getting started
Install it in a Node.js or TypeScript project:
npm i @onehorizon/sdk-js@latestPass any One Horizon bearer credential to Configuration.accessToken: a workspace API key for internal services, or an OAuth access token from an OAuth app.
import { Configuration, TasksApi } from '@onehorizon/sdk-js' const config = new Configuration({ accessToken: process.env.ONE_API_KEY })const tasks = new TasksApi(config) const bug = await tasks.reportBug({ workspaceId: 'current', report: { title: 'Checkout fails after applying a discount' }}) console.log(bug.taskId)
reportBug and submitIdea create items directly in Triage. One Horizon derives the reporter from the credential and supplies the scope, status, visibility, role, origin, and report time.
Add report context
Pass only the context your integration has:
import { LabelType, TaskPriority } from '@onehorizon/sdk-js' const idea = await tasks.submitIdea({ workspaceId: 'current', report: { title: 'Let customers save multiple shipping addresses', description: 'Customers want to reuse addresses during checkout.', reporterUserId: 'u_...', source: 'customer-portal', priority: TaskPriority.Medium, teamIds: new Set(['team_...']), assigneeIds: new Set(['u_...']), labels: [{ name: 'Checkout', type: LabelType.Component }] }})
For tasks that need explicit lifecycle, scope, kind, or routing fields, call createTask. The REST API guide covers follow-up links, documents, files, and error handling.
Webhook receivers
The webhook templates linked from Custom App use the SDK for CloudEvents typing and optional follow-up API calls. Webhooks covers delivery, verification, retries, and event handling.