Sublyzer SDK Reference
Complete documentation for all Sublyzer SDKs — JavaScript, TypeScript, Node.js, Python, PHP, Go, C++, React Native, Flutter, Swift, and Kotlin.
SDK Reference
Sublyzer provides native SDKs for 11 platforms. Each SDK auto-initializes, captures errors, sends events, and flushes data automatically. Use the tabs below to see documentation for your framework.
Installer (.exe)
Download — Windows app, writes SDK files into your project automatically.
SDK Customizer
https://www.sublyzer.com/sdk-customizer — generate & download SDK for any supported language.
Automatic vs manual
Use this split so you know what the SDK already does vs what you wire for product metrics.
Automatic (no code)
- JS errors & unhandled rejections
- Web Vitals / page load performance
- Page views (incl. SPA navigations)
- Clicks, form submits, device info
- Session IDs + batch flush to the API
Manual (your product events)
trackEvent— signup, checkout, trial_start, …identify— link events to a stable user idtrackError— business failures you catch yourselfflush— force send before a critical navigation
Dashboard Business Metrics and Overview KPIs fill from automatic traffic first. Funnel steps like signup → checkout need the manual examples below.
Business examples (signup · checkout · trial)
Three patterns for SaaS funnels. No marketplace / listing events — keep names stable so Overview and reports stay comparable.
1) Signup completed
// After account creation succeeds
Sublyzer.identify(user.id);
Sublyzer.trackEvent('signup_completed', {
method: 'email', // or 'google', 'sso'
plan: 'free',
source: 'landing_hero',
});2) Checkout / purchase
// After payment provider confirms success
Sublyzer.identify(user.id);
Sublyzer.trackEvent('checkout_completed', {
plan: 'pro',
amount: 29.99,
currency: 'EUR',
interval: 'monthly',
});3) Trial started
// When the trial clock starts (not when they only open pricing)
Sublyzer.identify(user.id);
Sublyzer.trackEvent('trial_started', {
plan: 'pro',
trial_days: 14,
source: 'pricing_cta',
});Verify first: DevTools → Network → collect / collect-batch → then Overview checklist should flip to SDK connected (event in last 15 min).
JavaScript SDK (Browser)
Drop-in script for any website. Captures errors, performance metrics, page views, clicks, form submissions, and device info automatically.
Best for: Static websites, WordPress, vanilla JS projects, or any HTML page.
Installation
Option A — Installer or SDK Customizer: download sublyzer-installer.exe or generate files at https://www.sublyzer.com/sdk-customizer (JavaScript → Browser).
Option B — Script tag (CDN):
<script src="https://www.sublyzer.com/sublyzer.js" data-integration-code="YOUR_INTEGRATION_CODE" defer ></script>
Option C — Self-hosted: place downloaded sublyzer.js in your static folder:
<script src="/sdks/sublyzer.js" data-integration-code="YOUR_INTEGRATION_CODE" defer></script>
There is no public npm package yet — use the installer, CDN script tag, or Customizer download above.
Configuration
// sublyzer.config.js
module.exports = {
integrationCode: 'YOUR_24_CHAR_CODE',
apiUrl: 'https://sublyzer-backend-production.up.railway.app',
debug: false,
};API
// Track a custom event
Sublyzer.trackEvent('purchase', { plan: 'pro', amount: 29.99 });
// Track an error manually
Sublyzer.trackError('Payment failed', error.stack);
// Identify a user (links events to a specific user)
Sublyzer.identify('user_12345');
// Force flush queued events
Sublyzer.flush();What's tracked automatically
- JavaScript errors & unhandled promise rejections
- Web Vitals (LCP, CLS)
- Page load performance (DOM, TTFB, DNS, TCP)
- Page views (including SPA navigation)
- Click tracking (tag, id, class, text, coordinates)
- Form submissions
- Device & browser info
Common Features (All SDKs)
- Auto-initialization — SDK validates the integration code on startup
- Error tracking — Uncaught exceptions and errors are captured automatically
- Event batching — Events queue locally and flush in batches (threshold: 10-20 events)
- Auto-flush — Queued events are sent every 30 seconds automatically
- Graceful shutdown — Events are flushed before the process/app exits
- Session & User IDs — Persistent identifiers for tracking across sessions
- identify() — Link events to a specific user ID
- Retry on failure — Failed flushes re-queue events for the next attempt
Need help? Join our Discord.