Skip to main content

API Client

The open-source LittleHorse SSO Workflow Bridge API Client is a javascript library that provides a type-safe interface for interacting with the SSO Workflow Bridge API.

warning

This API client is entirely optional. While it provides type-safe functions and convenience methods, you can interact directly with the SSO Workflow Bridge API using standard HTTP requests. The client simply makes it easier to integrate with the API by providing a typed interface and handling common patterns.

Installation

npm install @littlehorse-enterprises/sso-workflow-bridge-api-client

Authentication

You'll need to provide an access token when initializing the client. You can obtain this token through your organization's OIDC provider configured in the SSO Workflow Bridge API. For detailed configuration instructions, see the Configuration Guide.

Basic Usage

import { LHSWBApiClient } from "@littlehorse-enterprises/sso-workflow-bridge-api-client";

const client = new LHSWBApiClient({
baseUrl:
"Wherever your SSO Workflow Bridge API is hosted (e.g. http://localhost:8089)",
tenantId: "Your organization's tenant ID (e.g. default)",
accessToken:
"Your organization's OAuth access token (e.g. your-oauth-access-token)",
});

// List user tasks with pagination
const response = await client.listUserTasks({
limit: 10,
type: "approval",
status: "UNASSIGNED",
});

API Reference

The client provides two categories of methods:

  1. User Methods - For regular task interactions
  2. Admin Methods - For managing tasks and users

For a complete list of available methods and their parameters, see the API Methods Reference.

Error Handling

The client provides specific error types for different scenarios. See the Error Handling Guide for details on handling different types of errors.