@refariohq/sdk
v0.1.2
Published
Refario TypeScript telemetry SDK for LLM runs, spans, and MCP event ingestion
Downloads
11
Maintainers
Readme
SDK
Refario TypeScript SDK package: @refariohq/sdk.
This package publishes Refario telemetry helpers for run/span ingestion and MCP telemetry emission.
What is included
- Core ingestion client (
refario.init) for run/span events - MCP telemetry helper (
createMcpTelemetryEmitter) forsession/tool/modelstyle MCP events
MCP helper
import { createMcpTelemetryEmitter } from '@refariohq/sdk';
const mcpTelemetry = createMcpTelemetryEmitter({
endpoint: 'http://localhost:3000',
apiKey: 'YOUR_PROJECT_API_KEY',
defaultWorkflow: 'custom-mcp',
defaultTransport: 'stdio',
});
const session = mcpTelemetry.startSession({
sessionId: 'sess-123',
requestId: 'req-abc',
});
session.toolCall({ toolName: 'search_docs', correlationId: 'req-abc' });
session.toolResult({
toolName: 'search_docs',
correlationId: 'req-abc',
latencyMs: 120,
outputSample: '{"hits":3}',
});
await session.flush({ success: true });Local checks
From repo root:
NX_DAEMON=false NX_ISOLATE_PLUGINS=false bunx nx test sdk
NX_DAEMON=false NX_ISOLATE_PLUGINS=false bunx nx build sdk
NX_DAEMON=false NX_ISOLATE_PLUGINS=false npm_config_cache=.npm-cache npm pack --dry-run --workspace sdkRelease process
- Bump version in
sdk/package.json. - Commit and push to
main. - Create and push a release tag that matches the package version (for example
sdk-v0.1.1):
git tag sdk-v<version>
git push origin sdk-v<version>The Release TypeScript SDK GitHub Action publishes to npm when the tag is pushed.
You can also run the workflow manually via workflow_dispatch and optionally select a version bump (patch, minor, major, or custom).
Required GitHub secret
NPM_TOKENwith publish access for the@refariohqnpm scope.
