Overview
This page documents all configuration options available across the Databuddy SDK. Options are applicable to browser (JavaScript, React, Vue) and Node.js SDKs unless otherwise noted.Core Options
clientId
Your Databuddy project client ID. Get this from your dashboard.Browser SDK only. For Node.js, use
apiKey instead.Auto-detected from NEXT_PUBLIC_DATABUDDY_CLIENT_ID environment variable if not provided.apiKey
Your API key for authentication. Node.js SDK only.Format:
dbdy_xxxapiUrl
Custom API endpoint for event ingestion.
scriptUrl
Custom script URL for the browser bundle. Browser SDK only.
disabled
Disable all tracking. No events will be sent.
debug
Enable debug logging to console.
Tracking Features
trackWebVitals
Track Core Web Vitals metrics: LCP, FID, CLS, TTFB, FCP.
trackErrors
Track JavaScript errors automatically.
trackScrollDepth
Track scroll depth percentage at 25%, 50%, 75%, 100%.
trackOutgoingLinks
Track clicks on external links.
trackInteractions
Track user interactions (clicks, form submissions).
trackAttributes
Enable declarative tracking via
data-track attributes.trackHashChanges
Track hash changes in the URL (e.g.,
#section).trackPerformance
Track page performance metrics.
Batching & Performance
enableBatching
Enable event batching to reduce network requests.
batchSize
Number of events to batch before sending.Min: 1, Max: 50 (browser), 100 (Node.js)
batchTimeout
Time in milliseconds before auto-flushing batched events.Min: 100, Max: 30000
samplingRate
Fraction of sessions to track (0.0 to 1.0).Example:
0.5 = track 50% of sessionsRetry Configuration
enableRetries
Enable automatic retries for failed requests.
maxRetries
Maximum number of retry attempts.Only used if
enableRetries is true.initialRetryDelay
Initial delay in milliseconds before first retry. Uses exponential backoff.Only used if
enableRetries is true.Privacy & Filtering
ignoreBotDetection
Disable bot detection and track all visitors including bots.
skipPatterns
Array of glob patterns to skip tracking on matching paths.
maskPatterns
Array of glob patterns to mask sensitive paths.Wildcards are replaced with asterisks in tracked URLs.
/users/12345 becomes /users/*filter
Function to conditionally skip events. Return
false to skip.Browser SDK only. Must be set via window.databuddyConfig before script loads.Node.js Specific
websiteId
Default website ID to scope events to. Node.js SDK only.Can be overridden per event.
namespace
Default namespace for logical grouping. Node.js SDK only.Examples:
'billing', 'auth', 'api'source
Default source identifier for events. Node.js SDK only.Examples:
'backend', 'webhook', 'cron'maxQueueSize
Maximum number of events to queue before dropping. Node.js SDK only.
middleware
Array of middleware functions to transform or filter events. Node.js SDK only.Middleware runs before deduplication and batching.
enableDeduplication
Enable event deduplication based on
eventId. Node.js SDK only.maxDeduplicationCacheSize
Maximum deduplication cache size. Node.js SDK only.
logger
Custom logger instance. Node.js SDK only.
Advanced Options
sdk
SDK name for analytics identification.Only override for custom integrations.
sdkVersion
SDK version (defaults to package version).Only override for custom builds.
usePixel
Use pixel tracking (1x1 image) instead of script.Browser SDK only. Useful for email tracking or no-JS environments.
clientSecret
Client secret for server-side operations.Not required for browser usage. Never expose in client-side code.
Environment Variables
Browser SDK
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_DATABUDDY_CLIENT_ID | Auto-detected client ID | 3ed1fce1-5a56-4cbc-a917-66864f6d18e3 |
Node.js SDK
| Variable | Description | Example |
|---|---|---|
DATABUDDY_API_KEY | API key | dbdy_xxx |
DATABUDDY_WEBSITE_ID | Default website ID | website-uuid |
Configuration Examples
Production Browser Setup
Development Browser Setup
Node.js Production Setup
Node.js Serverless Setup
Next Steps
JavaScript SDK
Vanilla JavaScript usage guide
React SDK
React hooks and components
Vue SDK
Vue 3 composables and plugins
Node.js SDK
Server-side event tracking