telesink
v1.0.2
Published
Official JavaScript SDK for Telesink — real-time event tracking
Maintainers
Readme
Telesink SDK for JavaScript
Know what your product is doing. Right now.
Official JavaScript client for telesink.com - real-time event tracking.
Requirements
- Node.js 18+
- Any modern browser (with native
fetchandAbortController)
Getting started
Install
npm install telesinkConfiguration
Node.js
Set the environment variable:
export TELESINK_ENDPOINT=https://app.telesink.com/api/v1/sinks/your_sink_token_here/eventsBrowsers
window.TELESINK_ENDPOINT = "https://app.telesink.com/api/v1/sinks/your_sink_token_here/events";To disable tracking (e.g. in test/dev):
export TELESINK_DISABLED=true(or window.TELESINK_DISABLED = true in the browser)
Usage
Node.js and modern bundlers
import telesink from "telesink";
telesink.track({
event: "user.signed.up",
text: "[email protected]",
emoji: "👤",
properties: {
user_id: 123,
email_address: "[email protected]",
},
occurredAt: new Date(),
idempotencyKey: "my-key",
});Browser without bundler (Import Maps)
<script type="importmap">
{
"imports": {
"telesink": "https://esm.sh/telesink"
}
}
</script>
<script type="module">
import telesink from "telesink";
telesink.track({
event: "page.viewed",
text: "Homepage visited",
});
</script>Returns
true— event sent successfullyfalse— disabled, missing endpoint, or network error
License
MIT (see LICENSE.md).
