Configuration
SDK options, defaults, and tuning guidance for production.
Config options
RoSentry.init(options) supports:
| Option | Type | Default | Notes |
|---|---|---|---|
apiKey | string | "" | Required on server, optional on client |
environment | string | "production" | Use stable environment names |
endpoint | string | "https://rosentry.vercel.app/api/ingest" | Override for custom deployments |
enabled | boolean | true | Hard on/off switch |
sampleRate | number | 1.0 | Fraction of events kept (0.0 to 1.0) |
maxBreadcrumbs | number | 100 | In-memory breadcrumb cap |
maxQueueSize | number | 50 | Batch trigger threshold |
flushInterval | number | 5 | Seconds between queue flushes |
debug | boolean | false | Prints SDK internals |
autoCapture | boolean | true | Uses ScriptContext.Error capture |
captureWarnings | boolean | false | Captures warning log messages |
beforeSend | function | nil | Mutate/drop event before queueing |
Example
RoSentry.init({
apiKey = "rs_your_api_key_here",
environment = "production",
sampleRate = 0.5,
maxQueueSize = 25,
flushInterval = 3,
autoCapture = true,
captureWarnings = false,
beforeSend = function(event)
-- Example scrub
if event.context and event.context.custom then
event.context.custom.secret = nil
end
return event
end,
})Tuning guidance
- High traffic games: reduce
sampleRatefirst, thenmaxQueueSize - Debug sessions: enable
debugand temporarily setsampleRate = 1.0 - Sensitive environments: use
beforeSendto strip secrets and large payloads