Skip to main content

Using the API Client

The API Client is part of User Tasks Bridge. It provides a type-safe JavaScript/TypeScript interface for interacting with the User Tasks Bridge Backend, making it easier to integrate User Tasks into your application without worrying about the underlying HTTP requests.

note

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

Quick Example

import { LHSWBApiClient } from "@littlehorse-enterprises/user-tasks-bridge-api-client";

const client = new LHSWBApiClient({
baseUrl: "http://localhost:8089",
tenantId: "default",
accessToken: "<your-access-token>",
});

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

Reference Documentation

The client provides two categories of methods:

  1. User Methods - For regular task interactions (claim, complete, cancel, list tasks)
  2. Admin Methods - For managing tasks and users across the system (admin-only operations)