NexusConfig class
Configuration for Nexus.init.
Constructors
-
NexusConfig({required String apiKey, String baseUrl = 'https://services.inverge.net', String? realtimeUrl, bool autoTrackSessions = true, bool autoCaptureErrors = true, bool autoConnectRealtime = false, bool manageRealtimeWithLifecycle = true, bool flushOnBackground = true, Duration flushInterval = const Duration(seconds: 10), int maxBatch = 50, bool logging = false, NexusLogLevel? logLevel, NexusLogSink? onLog, bool replayEnabled = false, Duration replayInterval = const Duration(milliseconds: 1000), double replayPixelRatio = 1.0, bool replayMaskTextFields = true, bool replayCaptureConsole = true, bool replayCaptureNetwork = true, bool surveysEnabled = false, bool surveyAutoShow = true, bool inAppEnabled = false, bool inAppAutoShow = true, bool autoShowOverlay = true, bool liveActivityEnabled = false, bool voiceEnabled = false, bool remoteConfigEnabled = false, bool remoteConfigRealtime = false, Map<
String, Object?> remoteConfigDefaults = const {}, bool pushEnabled = false, bool pushAutoRequestPermission = true, String? pushWebVapidKey, bool pushForegroundDisplay = true, String pushAndroidChannelId = 'nexus_default', String pushAndroidChannelName = 'Notifications', String? appVersion, Map<String, Object?> defaultProperties = const {}}) -
const
Properties
- apiKey → String
-
Tenant API key (
nxs_...). Sent asx-api-keyon HTTP and in the socket handshake auth.final - appVersion → String?
-
App version reported with telemetry (e.g. from package_info). Optional.
final
- autoCaptureErrors → bool
-
Install a Flutter error handler that reports uncaught errors. Default
true.final - autoConnectRealtime → bool
-
Open the realtime (Socket.IO) connection automatically at startup, right
after the session is established — so the user is live without a manual
nexus.realtime.connect(). Rooms are still joined vianexus.realtime.join(...). Defaultfalse(realtime connection-minutes are billed — opt in). Works with manageRealtimeWithLifecycle.final - autoShowOverlay → bool
-
Auto-mount the survey + in-app overlays without touching
MaterialApp.builder(the SDK inserts them into the app's root overlay). Defaulttrue. Setfalseto mountNexusSurveyOverlay/NexusInAppOverlayyourself.final - autoTrackSessions → bool
-
Start (and keep alive) a journey session automatically. Default
true.final - baseUrl → String
-
Control-plane / data-plane origin. Partner endpoints live under
/partner.final -
defaultProperties
→ Map<
String, Object?> -
Properties merged into every event's/person's context.
final
- flushInterval → Duration
-
How often batched telemetry (events/logs) is flushed. Default 10s.
final
- flushOnBackground → bool
-
Flush queued telemetry when the app is backgrounded (so nothing is lost if
the OS kills the app). Default
true.final - hashCode → int
-
The hash code for this object.
no setterinherited
- httpBase → String
-
no setter
- inAppAutoShow → bool
-
Automatically show a triggered in-app message (session start / event). Set
falseto present manually vianexus.inApp.show(...). Defaulttrue.final - inAppEnabled → bool
-
Fetch in-app messages at startup (and on foreground) and show them via the
NexusInAppOverlay. Defaultfalse— opt in.final - liveActivityEnabled → bool
-
Enable Live Activities: iOS receives ActivityKit push updates (Lock Screen /
Dynamic Island); Android renders a live ongoing notification from the
server's data message. Drive them from the dashboard/API or via
nexus.liveActivity. Defaultfalse.final - logging → bool
-
Shorthand for verbose logging:
truemaps to NexusLogLevel.debug. Prefer logLevel for finer control. Defaultfalse.final - logLevel → NexusLogLevel?
-
Diagnostic log verbosity. When null, falls back to logging (
debugif on) and otherwise NexusLogLevel.warn — so failed requests and dropped telemetry are always visible, while the happy path stays quiet.final - manageRealtimeWithLifecycle → bool
-
Gracefully disconnect realtime when the app is backgrounded and reconnect
(rejoining rooms) on foreground. This makes billed connection-minutes
accurate — the app isn't charged while suspended. Default
true.final - maxBatch → int
-
Max items per batch flush. Default 50.
final
- onLog → NexusLogSink?
-
Optional sink to receive every log record (in addition to
debugPrint), e.g. to forward SDK diagnostics into your own logging.final - pushAndroidChannelId → String
-
Android channel id used for foreground notifications the SDK displays.
Match your server-side
android.notification.channel_idto keep foreground and background notifications on one channel. Defaultnexus_default.final - pushAndroidChannelName → String
-
Human-readable name for pushAndroidChannelId, shown in Android system
settings. Default
Notifications.final - pushAutoRequestPermission → bool
-
Ask the OS for notification permission when push is enabled. Default
true; setfalseto request it yourself at a better moment (then the token is registered on the next launch, or callnexus.push.start()).final - pushEnabled → bool
-
Fetch Remote Config at startup (and on foreground). Read values via
nexus.remoteConfig.getString(...)etc. Defaultfalse(billed per fetch — opt in). Set in-app fallbacks with remoteConfigDefaults. Turn-key push notifications. Whentrue, the SDK requests permission, obtains the device's FCM token, registers it with Nexus, re-registers on refresh, and reports notification opens — all automatically. You only need the platform Firebase config (google-services.json / GoogleService-Info.plist). Defaultfalse.final - pushForegroundDisplay → bool
-
Display notifications while the app is in the foreground. FCM does not
draw a notification when the app is open — on Android nothing shows unless
the app renders it, and on iOS the banner is suppressed by default. With
this
true(default) the SDK shows it for you: a native banner on iOS and a local notification on Android, tap-attributed like a background open. Setfalseif you handleFirebaseMessaging.onMessageyourself.final - pushWebVapidKey → String?
-
Web only — the VAPID public key for FCM web push. Required to obtain a web
token; ignored on iOS/Android.
final
- realtimeUrl → String?
-
Realtime (Socket.IO) origin. Defaults to baseUrl when null.
final
-
remoteConfigDefaults
→ Map<
String, Object?> -
In-app default Remote Config values, used until/unless the server provides
a value for a key. Mirrors Firebase
setDefaults.final - remoteConfigEnabled → bool
-
final
- remoteConfigRealtime → bool
-
Subscribe to realtime Remote Config updates: when a new template is
published, the app re-fetches automatically (Firebase Realtime RC). Needs
a realtime connection (see autoConnectRealtime). Default
false.final - replayCaptureConsole → bool
-
Tee the app's
debugPrintoutput into the replay stream so it shows in the player's Console tab (mirrors rrweb's console plugin). SDK-internal[Nexus]lines are skipped. On by default; setfalseto opt out.final - replayCaptureNetwork → bool
-
Automatically capture HTTP requests for the player's Network tab via
HttpOverrides— covers both Dio andpackage:http(anydart:ioclient) with no wiring. Requests to the Nexus API are excluded. On by default (no effect on web — use a Dio interceptor there). Setfalseto opt out (e.g. if the app installs its ownHttpOverrides).final - replayEnabled → bool
-
Record session replay: periodic screenshots of the app + pointer events,
shipped as rrweb frames. Requires wrapping the app in
NexusScope. Wrap sensitive widgets inNexusMaskto redact them. Defaultfalse(billed / privacy-sensitive — opt in explicitly).final - replayInterval → Duration
-
How often a replay frame is captured. Lower = smoother but more data/CPU.
Default 1s. Identical consecutive frames are dropped automatically.
final
- replayMaskTextFields → bool
-
Automatically redact every text input (anything backed by
EditableText—TextField,TextFormField,CupertinoTextField,SelectableText) from replay frames, so typed content (passwords, PII) is never captured. On by default; useNexusMaskfor finer control. Setfalseto opt out.final - replayPixelRatio → double
-
Capture resolution as a multiple of logical pixels. 1.0 ≈ device-independent
resolution (small, fast); raise toward
MediaQuery.devicePixelRatiofor crisper frames, lower (e.g. 0.75) to shrink payloads. Default 1.0.final - resolvedLogLevel → NexusLogLevel
-
Effective log level: explicit logLevel, else
debugwhen logging is on, elsewarn.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- socketBase → String
-
no setter
- surveyAutoShow → bool
-
Automatically show eligible popover/banner surveys (and event-triggered
ones on
events.track). Setfalseto present surveys manually vianexus.surveys.show(...). Defaulttrue.final - surveysEnabled → bool
-
Fetch eligible in-product surveys at startup (and on foreground). Requires
NexusSurveyOverlayin yourMaterialApp.builderto display them. Defaultfalse(billed per response — opt in).final - voiceEnabled → bool
-
Enable Nexus Voice (CPaaS calling). Exposes
nexus.voice— place/answer calls, in-call controls, DTMF, quality. Register a media engine (WebRTC) and optionally CallKit to actually carry audio / show the native call UI. Defaultfalse.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited