Telesink JavaScript SDK

/ / X · Bluesky · Mastodon

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

It is deliberately tiny, has zero runtime dependencies (native fetch + AbortController), and gets out of your way. You install it, set one variable, and start sending events.

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 — any errors are logged to the console and the call fails gracefully so your app stays happy.

What’s under the hood

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

Next steps

Ruby first, JavaScript second. I’ll be shipping official SDKs for Python, Go, PHP and more next — let me know on X which one you want first.

The complete source is at github.com/telesink/telesink-javascript. It’s MIT licensed, obviously.

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

Follow along on X at @kyrylo.