JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28
  • Score
    100M100P100Q87508F
  • License MIT

TypeScript SDK for creating TryAgent escalations.

Package Exports

  • @tryagent/sdk

Readme

@tryagent/sdk

TypeScript SDK for creating TryAgent escalations from AI agents and workflows.

Install

pnpm add @tryagent/sdk
npm install @tryagent/sdk

Usage

import { TryAgent } from "@tryagent/sdk";

const tryagent = new TryAgent({
  apiKey: process.env.TRYAGENT_API_KEY!,
});

const escalation = await tryagent.escalate("orders.auth_doc", input);

console.log(escalation.id);

See docs/quickstart.mdx for the full create-escalation, signed-callback, and resume flow.

The SDK defaults to https://api.tryagent.ai. Pass baseUrl for local development or tests.

const tryagent = new TryAgent({
  apiKey: process.env.TRYAGENT_API_KEY!,
  baseUrl: "http://localhost:4000",
});

Errors

Non-2xx API responses and network failures throw ApiError.

import { ApiError } from "@tryagent/sdk";

try {
  await tryagent.escalate("orders.auth_doc", input);
} catch (error) {
  if (error instanceof ApiError) {
    console.error(error.status, error.message, error.requestId);
  }
}

Development

pnpm --filter @tryagent/sdk typecheck
pnpm --filter @tryagent/sdk test
pnpm --filter @tryagent/sdk run pack:dry-run