Telesink JavaScript SDK

Kyrylo Silin
Kyrylo Silin
Telesink founder

Ruby came first. JavaScript is here now. The official telesink package works everywhere: Node.js, modern browsers, bundlers, and even plain HTML with import maps.

I kept the package small. It uses native fetch and AbortController, with no runtime dependencies. Install it, set one endpoint, and send an event.

Installation

Run:

npm install telesink

Configuration

The SDK is configured entirely through environment variables (Node.js) or window globals (browser). No classes, no config objects, no YAML.

Set your sink endpoint:

# Node.js
export TELESINK_ENDPOINT=https://app.telesink.com/api/v1/sinks/your_sink_token_here/events

# Browser
window.TELESINK_ENDPOINT = "https://app.telesink.com/api/v1/sinks/your_sink_token_here/events";

For self-hosted instances, just change the URL to point at your own server.

To disable tracking (for example in tests or local development):

# Node.js
export TELESINK_DISABLED=true

# Browser
window.TELESINK_DISABLED = true;

Usage

import telesink from "telesink";

const success = await telesink.track({
  event: "User signed up",
  text: "[email protected]",
  emoji: "👤",
  properties: {
    plan: "pro",
    source: "landing_page",
    user_id: 123,
    email_address: "[email protected]"
  },
  occurredAt: new Date(),        // optional, defaults to now
  idempotencyKey: "my-key"       // optional, UUID generated if omitted
});

The promise resolves to true if the event was sent successfully and false otherwise (disabled, missing endpoint, or network error). It will never raise exceptions. Errors are logged to the console, and the call fails quietly. Tracking should not interrupt your product.

What’s under the hood

The package is around 80 lines of plain JavaScript using only native APIs. It:

  • adds an Idempotency-Key header automatically
  • tags every payload with sdk: { name: "telesink.javascript", version: "1.0.1" }
  • times out after 3 seconds
  • works identically in Node.js 18+ and any modern browser
  • works with both the hosted version and any self-hosted instance

Next steps

Ruby first, JavaScript second. Python, Go, PHP, and more are next. Let me know on X which one you want first.

The complete source is at github.com/telesink/telesink-javascript. It is MIT licensed.

Now go connect your app (frontend or backend) and watch events appear in your Telesink feed.

Follow along on X at @kyrylo.