This page covers how to install Saytics in two environments: as a browser JavaScript library for client-side tracking, and as a Node.js library for server-side event collection. Choose the tab that matches your setup — many teams use both.Documentation Index
Fetch the complete documentation index at: https://docs.saytics.com/llms.txt
Use this file to discover all available pages before exploring further.
- Browser
- Node.js
Install the Saytics JavaScript SDK with npm:Alternatively, load Saytics from the CDN by adding this script tag to your HTML Once installed, initialize the SDK with your write key. Pass an optional configuration object as the second argument to customize behavior.
<head>. The async attribute prevents the script from blocking page rendering.Configuration options
Pass these options as the second argument toSaytics.init() (browser) or the constructor options object (Node.js).
Your project’s write key from Settings → API Keys. Required to authenticate all events.
Enable console logging for every event sent and any SDK errors. Useful during development. Disable in production.
Override the default API endpoint. Use this if you’re proxying Saytics traffic through your own domain.
Number of events to accumulate before flushing to the API in a single request. Reducing this value sends events more frequently; increasing it reduces network requests.
Use your write key (not secret key) for client-side code. The write key is safe to expose in browser environments.
Next steps
- Quick start guide — send your first event end-to-end
- JavaScript SDK reference — all available methods and advanced options