ChangelogEdit pageSTAFFOpen dashboard

BubblCredential

struct · Swiftclass · Kotlintype · TypeScriptclass · Dart

A device credential from pairing a phone with a code, to start Bubbl with instead of the SDK API key. The device then never registers itself.

Start with your SDK API key: Bubbl then gets each install its own credential by itself. A BubblCredential is for a phone that was paired with a code, as Bubbl's Showcase app is; there's no dashboard page or server API that issues credentials for your own app's installs. More in Starting with a device credential.

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.

How starting with a credential works#

  • Start with it where you'd start with a key, the same way at every launch: Bubbl.start on Android and iOS, Bubbl.startWithCredential on Flutter and React Native.
  • installId must be the install the credential was issued for. A pairing flow passes the same install id it sent when pairing.
  • Starting again with the same credential changes nothing. A different credential, or a switch between an API key and a credential, wipes what Bubbl kept on the device and starts afresh as a new device.
  • registered in diagnostics is true straight away: there's no registration to wait for.
  • If the server refuses the credential, Bubbl stops. You get a credential-rejected event, and credentialRejected is true in diagnostics. Bubbl doesn't retry on its own: the next start tries again, so start it with a new credential.
  • Bubbl keeps its own copy of the secret in the Android Keystore or the iOS Keychain. Keep yours in secure storage too, and never log it.

Fields#

An empty keyId, secret or installId is a mistake, like an empty API key: Bubbl.start: the credential is incomplete.

class BubblCredential(keyId, secret, installId). Two credentials are equal when all three fields are. toString() leaves the secret out.

keyId
String
The credential's key id (bdk_…), sent with every request.
secret
String
The credential's secret, which signs every request. Kept in the Android Keystore and never sent.
installId
String
The install the credential was issued for.
Android throws on an incomplete credentialBubbl.start throws IllegalArgumentException when any field is blank. The other platforms log the same text instead.

public struct BubblCredential: Sendable, Equatable, made with init(keyId: String, secret: String, installId: String). The secret never shows: not in description, debugDescription, dump or the debugger (CustomReflectable).

keyId
String
The credential's key id.
secret
String
The credential's secret. Kept in the Keychain and never shown.
installId
String
The install the credential was issued for.

const BubblCredential({required String keyId, required String secret, required String installId}). Two credentials are equal when all three fields are. toString() leaves the secret out.

keyId
String
The credential's key id.
secret
String
The credential's secret. Sent to the native SDK only, never logged or printed.
installId
String
The install the credential was issued for.

type BubblCredential, a plain object. startWithCredential hands the fields to the native SDK as they are, not in JSON or a log.

keyId
string
The credential's key id.
secret
string
The credential's secret. Keep it out of logs and analytics.
installId
string
The install the credential was issued for.