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.Get labels
List projects
AnnotationQueue Class — Full Queue Management
TheAnnotationQueue 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
AnnotationQueuefor 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
logAnnotationsandaddItemscan 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.
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.