Skip to main content

JavaScript SDK

The FutureAGI JavaScript/TypeScript SDK provides two primary classes: Annotation for logging annotations via a DataFrame-style interface, and AnnotationQueue for full queue lifecycle management.

Installation


Annotation Class — Log Annotations

Initialize the client

Log annotations

Log annotations using DataFrame-style records. Each record is an object with column keys following the same naming convention as the Python SDK.
For the full column naming convention table, see the Python SDK — Column naming convention. The format is identical across both SDKs.

Get labels

List projects


AnnotationQueue Class — Full Queue Management

The AnnotationQueue class provides complete programmatic control over the annotation queue lifecycle: creating queues, adding items, assigning work, submitting annotations, and exporting results.

Initialize the client

Create a queue

Add items to a queue

Valid source types

Submit annotations

Create scores directly (without queue)

You can create scores against any source without going through a queue workflow.

Bulk create scores

Queue lifecycle

Progress and analytics

Export


Complete Method Reference

AnnotationQueue methods


Best Practices

  • Use logAnnotations() for bulk SDK-based annotation — The DataFrame-style format is the fastest way to annotate many spans at once.
  • Use AnnotationQueue for programmatic queue management — Create, assign, and complete queues entirely from code.
  • Use createScore() / createScores() for direct score creation — Bypass the queue workflow when you need to attach scores to traces directly.
  • Always handle errors — Check for partial failures in bulk operations. Both logAnnotations and addItems can succeed for some records and fail for others.
  • Use TypeScript — All SDK methods are fully typed. TypeScript catches column name typos and invalid configurations at compile time.
Bulk operations (logAnnotations, addItems, createScores) may partially succeed. Always inspect the response for per-record errors before assuming all records were processed.

Next steps

Python SDK

DataFrame-based annotation logging with the Python SDK.

Scores API

Query and manage annotation scores via the REST API.

Queues API

REST API reference for queue CRUD operations.