brokle-javascript-sdk

Guide building and debugging the Brokle JavaScript/TypeScript SDK with OpenTelemetry integration patterns.

1|Updated Jul 15, 2025
One-click install
npx skills add https://github.com/brokle-ai/brokle-js --skill brokle-javascript-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: brokle-javascript-sdk
Source: https://github.com/brokle-ai/brokle-js/tree/main/.claude/skills/brokle-javascript-sdk
Command: npx skills add https://github.com/brokle-ai/brokle-js --skill brokle-javascript-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured development guide for building and debugging the Brokle JavaScript/TypeScript SDK, helping teams deliver a robust OTEL-native observability solution for AI applications.

Core Features & Use Cases

  • Comprehensive architecture overview of the single package with sub-path exports and a full OpenTelemetry pipeline.
  • Practical integration patterns including @observe decorator, startActiveSpan, startActiveGeneration, OpenAI/Anthropic wrappers, and LangChain integration.
  • Development workflow guidance covering building, testing, linting, deployment, lifecycle management, and Dual Build outputs for ESM/CJS.

Quick Start

Follow this guide to explore the source tree, install dependencies, run builds, and experiment with a minimal setup that demonstrates tracing and generation capabilities.

Frequently Asked Questions about brokle-javascript-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add OpenTelemetry tracing to a JavaScript AI application?

The SDK provides a full OpenTelemetry pipeline with an @observe decorator and startActiveSpan function to capture execution spans automatically within your JavaScript AI application.

Can I wrap OpenAI and LangChain calls for observability in TypeScript?

Yes, the SDK provides dedicated OpenAI and Anthropic wrappers alongside LangChain integration patterns to automatically trace generations and monitor AI application performance in TypeScript.

What is the best way to build an SDK that supports both ESM and CJS?

The best way is to implement a Dual Build process during the deployment workflow, which this SDK outlines to output both ESM and CJS module formats robustly using managed lifecycle configurations.

Does this observability SDK require a complex package architecture?

No, it uses a single package architecture with sub-path exports rather than a complex multi-package setup, simplifying dependency management while maintaining modular access to tracing and generation features.

How do I start an active generation span for AI observability?

You can start an active generation span by calling the startActiveGeneration function, which integrates directly with the OpenTelemetry pipeline to capture specific AI generation metrics and trace data.