BubblCredential
struct · Swiftclass · Kotlintype · TypeScriptclass · DartA 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.
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.starton Android and iOS,Bubbl.startWithCredentialon Flutter and React Native. installIdmust 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.
registeredin diagnostics istruestraight away: there's no registration to wait for.- If the server refuses the credential, Bubbl stops. You get a credential-rejected event, and
credentialRejectedistruein diagnostics. Bubbl doesn't retry on its own: the nextstarttries 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.
bdk_…), sent with every request.Bubbl.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).
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.
type BubblCredential, a plain object. startWithCredential hands the fields to the native SDK as they are, not in JSON or a log.