Web SDK · v0.2.0
Connect EventLoom
Send product behavior, identity, page context, errors, and Web Vitals through one browser client. The first verified event should take less than ten minutes.
01
Quickstart
Create a Web source under Data sources, copy the write key when it appears, then install the package.
pnpm add @event-loom/webimport { createEventLoom } from "@event-loom/web";
export const analytics = createEventLoom({
writeKey: "el_live_...",
autoCapture: {
pageViews: true,
errors: true,
performance: true,
},
});A write key can only submit events. Use separate sources and keys for production, staging, and development.
02
Track product events
Name events with lowercase verbs and underscores. Names must match ^[a-z][a-z0-9_]*$.
analytics.track("checkout_started", {
plan: "basic",
value: 60,
annual: false,
});Properties support strings, numbers, booleans, null, and arrays of those values. Avoid large objects and sensitive information.
03
Identify users
Call identify when a stable application user ID is available. Reset identity immediately after sign-out.
analytics.identify("user_123", {
country: "US",
plan: "pro",
});
// On sign-out
analytics.reset();04
Automatic capture
Automatic collection is off by default. Page capture observes initial load and SPA navigation. Click capture only reads elements you explicitly mark and never reads input values.
<button
data-eventloom-event="signup_clicked"
data-eventloom-properties='{"location":"hero"}'
>
Sign up
</button>Use analytics.page() for manual page events andanalytics.screen() for screen-like flows.
05
Report handled errors
Uncaught errors can be collected automatically. Add business context when you catch a failure yourself.
try {
await submitOrder();
} catch (error) {
analytics.error("checkout_failed", error, {
step: "payment",
});
}06
Consent and privacy
If consent is required, disable collection before producing any events. Disabling clears the pending local queue.
analytics.setEnabled(false);
// After consent
analytics.setEnabled(true);- Do not send passwords, tokens, or payment details.
- Marked click capture does not collect visible text.
- Unsent events are limited to 1,000 in local storage.
07
Configuration
createEventLoom({
writeKey: "el_live_...",
endpoint: "https://ingest.geteventloom.com/v1/events",
flushAt: 20,
flushIntervalMs: 10_000,
maxRetries: 2,
debug: true,
});08
Verify delivery
Send one named event and flush it immediately.
analytics.track("integration_verified");
await analytics.flush();- 1Open EventLoom Data sources.
- 2Confirm the source changes from Waiting to Receiving.
- 3Confirm integration_verified appears in Events.
- 4Disable debug mode before production release.