Install and configure
The JavaScript SDK adds explicit business telemetry to a trusted Node.js process. Automatic HTTP/database instrumentation can continue to use regular OpenTelemetry.
service.name and an environment on every service, and verify signals in the console after starting the process.npm install @telemio/sdk
export TELEMIO_API_KEY="your-server-ingest-key"telemetry.ts
import { createTelemio } from "@telemio/sdk"
export const telemio = createTelemio({
apiKey: process.env.TELEMIO_API_KEY,
serviceName: "checkout-api",
environment: process.env.NODE_ENV || "development",
release: process.env.APP_VERSION || "local"
})Instrument a real request
Wrap a meaningful operation, record failures, and export an outcome metric. Await SDK calls where you need delivery guarantees.
checkout.ts
import { telemio } from "./telemetry"
export async function completeOrder(orderId: string, charge: () => Promise<void>) {
return telemio.tracer.withSpan("checkout.complete", async (span) => {
span.setAttribute("order.id", orderId)
await charge()
await telemio.metrics.count("checkout.completed", 1, { channel: "web" })
await telemio.logger.info("Order completed", { "order.id": orderId })
return { orderId, status: "completed" }
}, { "checkout.channel": "web" })
}Never record card numbers, API tokens, passwords, or raw customer payloads in attributes. Use stable identifiers only when your privacy policy permits them.
Feature flags and rollout
Evaluate on your server with a stable targeting key. A safe default is returned when evaluation cannot be performed.
const decision = await telemio.flags.boolean(
"new-checkout", false, { targetingKey: accountId }
)
if (decision.value) {
await runNewCheckout()
} else {
await runClassicCheckout()
}Use a workspace or feature credential configured for flag evaluation; an ingest-only key does not grant additional permissions.
Verify the integration
Create a test order and inspect the service and environment in Telemio. Confirm a checkout span, a log and a metric.
If nothing appears, verify TELEMIO_API_KEY, network egress to https://api.telemio.sh, the configured service name, and your credentials. See the SDK reference.