Installation
Install the SDK using your preferred package manager.CDN (no bundler)
If you’re not using a bundler, load the SDK directly from the Cano CDN by adding this tag to your HTML<head>:
index.html
Cano constructor is available on window.Cano.
Initialization
Import and instantiate the client once — typically in your app’s entry point — then reuse it throughout your codebase.app.js
Core Methods
cano.track(event, properties?)
Call track every time a user performs a meaningful action. Pass an event name and an optional object of properties that describe the action.
cano.identify(userId, traits?)
Call identify when you know who the current user is — for example, after they log in or sign up. Pass a stable user ID and any traits you want to associate with that profile.
cano.page(pageName?, properties?)
Call page to record that a user has viewed a page or screen. Supply an optional name and any additional context about the page.
cano.setSuperProperties(properties)
Super properties are key-value pairs that are automatically merged into every subsequent track call. Use them for attributes that apply across all events — like app version or environment.
cano.alias(newId, previousId)
Call alias to merge two user identities — for example, when an anonymous visitor signs up and you want to connect their pre-signup activity to their new account.
cano.reset()
Call reset to clear the current user’s identity and super properties from the SDK — typically on logout. Subsequent events will be attributed to a new anonymous session.
cano.flush()
flush forces the SDK to immediately send any events queued in memory, bypassing the normal batchSize and flushInterval thresholds. It returns a Promise that resolves when the flush completes.
Error Handling
Wrapflush() calls in a try/catch (or .catch) to handle network errors and API rejections gracefully.
error-handling.js
Individual
track, identify, and page calls are buffered in memory and do not throw on their own. Errors surface when the buffer is flushed — either automatically by the SDK or manually via cano.flush().TypeScript Support
The SDK ships with first-class TypeScript definitions — no@types package needed. All constructor options, method signatures, and event property maps are fully typed.
app.ts