ChangelogEdit pageSTAFFOpen dashboard

BubblOptions

struct · Swiftdata class · Kotlintype · TypeScriptclass · Dart

How Bubbl.start sets Bubbl up. The base URL is the only option you must set.

You pass BubblOptions to start (or startWithCredential on Flutter and React Native). Every option except baseUrl has a default. Starting again with the same key and the same options changes nothing.

Base URLs before the 5.0 releaseUntil 5.0 is released, the Sandbox base URL is https://api.sandbox.staging.bubbl.tech and the Production base URL is https://api.staging.bubbl.tech.

Options#

The base URL is the host root, such as https://api.sandbox.bubbl.tech. Don't add a path: the SDK adds it. It must be https://. Plain http:// is allowed only for local development, to localhost, 127.0.0.1, 10.0.2.2 or a *.test host. The key and the base URL must be from the same workspace, Sandbox or Production: see Sandbox and Production.

data class BubblOptions @JvmOverloads constructor(baseUrl, requireConsent, logLevel, segments), so Java can pass only the base URL: new BubblOptions("https://…").

baseUrl
String
The Bubbl API to talk to. Required: 5.0 has no default host. A URL that isn't allowed makes start throw IllegalArgumentException.
requireConsent
Boolean
Default false. When true, Bubbl does nothing (no network, no location, no notifications) until Bubbl.setConsent(true).
logLevel
BubblOptions.LogLevel
Default LogLevel.WARNING. How much Bubbl writes to Logcat, under the tag BubblSDK.
segments
List<String>?
Default null. The device's segments, as Bubbl.setSegments would set them. null leaves them as they are.
LogLevel.NONE
BubblOptions.LogLevel
Nothing.
LogLevel.ERROR
BubblOptions.LogLevel
Errors only.
LogLevel.WARNING
BubblOptions.LogLevel
Errors and warnings. The default.
LogLevel.INFO
BubblOptions.LogLevel
Also what Bubbl does as it goes.
LogLevel.DEBUG
BubblOptions.LogLevel
Everything, for development.

public struct BubblOptions: Sendable, Equatable, made with init(baseUrl: String, requireConsent: Bool = false, logLevel: LogLevel = .warning, segments: [String]? = nil). Its properties are vars.

baseUrl
String
The Bubbl API to talk to. Required: 5.0 has no default host. A URL that isn't allowed is logged and start does nothing.
requireConsent
Bool
Default false. When true, Bubbl does nothing (no network, no location, no notifications) until Bubbl.setConsent(true).
logLevel
BubblOptions.LogLevel
Default .warning. How much Bubbl writes to the unified log, under the subsystem tech.bubbl.sdk.
segments
[String]?
Default nil. The device's segments, as Bubbl.setSegments would set them. nil leaves them as they are.

BubblOptions.LogLevel is a String enum (Sendable, Equatable, CaseIterable, Codable):

.none
BubblOptions.LogLevel
Nothing.
.error
BubblOptions.LogLevel
Errors only.
.warning
BubblOptions.LogLevel
Errors and warnings. The default.
.info
BubblOptions.LogLevel
Also what Bubbl does as it goes.
.debug
BubblOptions.LogLevel
Everything, for development.
Local http on iOSApp Transport Security blocks a local http:// base URL unless your app's Info.plist sets NSAppTransportSecurity › NSAllowsLocalNetworking. Set it in development builds only.

const BubblOptions({required String baseUrl, bool requireConsent = false, BubblLogLevel logLevel = BubblLogLevel.warning, List<String>? segments}).

baseUrl
String
The Bubbl API to talk to. Required: 5.0 has no default host. A URL that isn't allowed is logged natively, never thrown.
requireConsent
bool
Default false. When true, Bubbl does nothing (no network, no location, no notifications) until Bubbl.setConsent(true).
logLevel
BubblLogLevel
Default BubblLogLevel.warning. How much Bubbl logs natively: Logcat tag BubblSDK, or the iOS unified log's subsystem tech.bubbl.sdk. Not the Dart console.
segments
List<String>?
Default null. The device's segments, as Bubbl.setSegments would set them.

BubblOptions also has Map<String, Object?> toJson(), the options as they cross to the native SDK. The log levels are a top-level enum:

BubblLogLevel.none
BubblLogLevel
Nothing.
BubblLogLevel.error
BubblLogLevel
Errors only.
BubblLogLevel.warning
BubblLogLevel
Errors and warnings. The default.
BubblLogLevel.info
BubblLogLevel
Also what Bubbl does as it goes.
BubblLogLevel.debug
BubblLogLevel
Everything, for development.

type BubblOptions, a plain object.

baseUrl
string
The Bubbl API to talk to. Required: 5.0 has no default host. A URL that isn't allowed is logged natively, never thrown.
requireConsent
boolean (optional)
Default false. When true, nothing runs (no network, location or notifications) until Bubbl.setConsent(true).
logLevel
LogLevel (optional)
Default 'warning'. How much Bubbl logs natively: Logcat tag BubblSDK, or the iOS unified log's subsystem tech.bubbl.sdk.
segments
string[] (optional)
The device's segments, as Bubbl.setSegments would set them.
LogLevel
'none' | 'error' | 'warning' | 'info' | 'debug'
The log levels, from nothing to everything. 'warning' (errors and warnings) is the default.
Local http on AndroidYour app's network security config must also allow cleartext traffic to the local host you use.