Configuration
DobroDeskFlutterClient
Required
Framework configuration supplies app identity and account scope and obtains a fresh short-lived authorization token from the host credential provider. Token and result shapes follow the displayed platform signature.
DobroDeskFlutterClient({ required String integrationId, required String apiOrigin, required String accountScope, String? authorizationToken, Future<String> Function()? credentialProvider, String locale = 'en', Duration pollInterval = const Duration(seconds: 1), Map<String, Object?>? context, Map<String, DobroDeskHostActionHandler>? hostActions, MethodChannel? methodChannel, EventChannel? eventChannel })- Errors
- invalid-config
Lifecycle and conversation
DobroDeskFlutterClient
Creates the client and validates the integration configuration.
new DobroDeskFlutterClient({ integrationId, apiOrigin, accountScope, authorizationToken?, credentialProvider? })startSession
Starts one conversation with an idempotent initial message.
startSession(String message, { prefill?, idempotencyKey?, metadata?, timeZone?, turnstileToken?, startedAt? }): Future<DobroDeskSession>- Errors
- network
- field-invalid
- idempotency-conflict
- outbox-corrupt
resumeSession
Restores account-scoped state or resumes a server session when one exists.
resumeSession(): Future<DobroDeskSession?>- Errors
- network
- session-expired
- outbox-corrupt
refresh
Loads the current conversation snapshot.
refresh(): Future<DobroDeskSnapshot>- Errors
- network
- session-expired
- message-rejected
waitForAssistant
Polls with bounded timing until assistant work completes or the wait expires.
waitForAssistant({ timeout?, afterMessageCount? }): Future<DobroDeskSnapshot>- Errors
- realtime-unavailable
- network
- session-expired
sendMessage
Sends a message and returns its accepted, queued or review status.
sendMessage(String text, { String? idempotencyKey }): Future<DobroDeskAcceptedMessage>- Errors
- network
- idempotency-conflict
- conversation-stale
- rate-limited
- message-rejected
flushOutbox
Replays pending mutations with the original body and idempotency key.
flushOutbox(): Future<List<DobroDeskAcceptedMessage>>- Errors
- network
- outbox-corrupt
- session-expired
resetSession
Clears the account-scoped session, snapshot and pending mutations.
resetSession(): Future<void>- Errors
- request-in-progress
- outbox-corrupt
logout
Ends the active customer session and disposes optional capability state.
logout(): Future<void>- Errors
- outbox-corrupt
presentWidget
Presents the native widget using the shared widget experience.
presentWidget({ title?, subtitle?, appearance?, platform?, reduceMotion?, view?, articleId?, context?, hostActionIds? }): Future<void>Parameters
titleString?- Bounded copy overrides for the shared widget copy keys.
subtitleString?- Bounded copy overrides for the shared widget copy keys.
appearanceMap<String, Object?>?- The shared appearance-v2 object: colors, typography, layout and shadow within documented bounds.
platformMap<String, Object?>?- Platform-specific safe-area, keyboard and navigation overrides within the shared design contract.
reduceMotionbool?Default:system- Use the system setting by default. Native hosts also respect accessibility, low-power and thermal policies.
viewString?- Native navigation and web launcher or panel presentation options.
articleIdString?- Bounded JSON context supplied to explicitly registered host actions.
contextMap<String, Object?>?- Bounded JSON context supplied to explicitly registered host actions.
hostActionIdsList<String>?- Allowlisted application callbacks for guided widget actions. They do not authenticate network requests.
- Errors
- invalid-config
- request-in-progress
- field-invalid
closeWidget
Closes the current native presentation or releases a mounted host.
closeWidget(): Future<void>events
Subscribes to canonical SDK events. Release the listener with the subscription, cancellation callback or stream subscription returned by that platform.
events: Stream<DobroDeskEvent>operations
Exposes typed form, client-tool, attachment and commerce operations over the native engine.
operations: DobroDeskOperationssubmitForm
Submits bounded values for a server-provided conversation form. The request identifier and values are validated before the signed native request is sent.
operations.submitForm(String requestId, Map<String, Object?> values): Future<Object?>Parameters
requestIdStringRequired- Submits bounded values for a server-provided conversation form. The request identifier and values are validated before the signed native request is sent.
valuesMap<String, Object?>Required- Submits bounded values for a server-provided conversation form. The request identifier and values are validated before the signed native request is sent.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- message-rejected
requestClientTool
Requests an allowlisted client tool, acknowledges its result or reads its status. Tool payloads are flat, bounded and reject sensitive field names.
operations.requestClientTool(input: DobroDeskClientToolRequest): Future<Object?>Parameters
inputDobroDeskClientToolRequestRequired- Requests an allowlisted client tool, acknowledges its result or reads its status. Tool payloads are flat, bounded and reject sensitive field names.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- not_found
completeClientTool
Requests an allowlisted client tool, acknowledges its result or reads its status. Tool payloads are flat, bounded and reject sensitive field names.
operations.completeClientTool(input: DobroDeskClientToolResult): Future<Object?>Parameters
inputDobroDeskClientToolResultRequired- Requests an allowlisted client tool, acknowledges its result or reads its status. Tool payloads are flat, bounded and reject sensitive field names.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- not_found
clientToolStatus
Requests an allowlisted client tool, acknowledges its result or reads its status. Tool payloads are flat, bounded and reject sensitive field names.
operations.clientToolStatus(String callId): Future<Object?>Parameters
callIdStringRequired- Requests an allowlisted client tool, acknowledges its result or reads its status. Tool payloads are flat, bounded and reject sensitive field names.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- not_found
procedureAction
Advances a server-provided procedure action with an idempotency key and the expected workflow revision.
operations.procedureAction(input: DobroDeskProcedureAction): Future<Object?>Parameters
input.actionstart | answer | availability | select | calendar_date | back | confirm | declineRequired- Advances a server-provided procedure action with an idempotency key and the expected workflow revision.
input.valueStringRequired- Advances a server-provided procedure action with an idempotency key and the expected workflow revision.
input.idempotencyKeystring (16-128 characters)Required- Advances a server-provided procedure action with an idempotency key and the expected workflow revision.
input.procedureId / runId / expectedUpdatedAtString?- Advances a server-provided procedure action with an idempotency key and the expected workflow revision.
input.locale"en" | "uk" | "de" | "es"?- The widget locale used for content. Web defaults to auto; native widget bundles currently support en, uk, de and es.
input.stepId / parameterId / timeZoneString?- Advances a server-provided procedure action with an idempotency key and the expected workflow revision.
input.nativeCommerceUitrue?- Advances a server-provided procedure action with an idempotency key and the expected workflow revision.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- message-rejected
- idempotency-conflict
attachmentIntents
Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
operations.attachmentIntents(String messageId, List<DobroDeskAttachmentDescriptor> attachments): Future<Object?>Parameters
messageIdStringRequired- Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
attachmentsDobroDeskAttachmentDescriptor[] (1-5; each up to 10 MiB)Required- Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- attachment_policy_failed
- attachment_rate_limited
uploadAttachment
Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
operations.uploadAttachment(DobroDeskUploadIntent intent, String fileUri, String mimeType): Future<Object?>Parameters
intentDobroDeskUploadIntentRequired- Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
fileUriString (file:// or content:// URI)Required- Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
mimeTypeStringRequired- Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- attachment_policy_failed
- attachment_rate_limited
listOrders
Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
operations.listOrders({String? cursor, String? store}): Future<Object?>Parameters
query{String? cursor, String? store}- Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- commerce_identity_required
- commerce_unavailable
- shopify_reconnect_required
- shopify_rate_limited
orderDetail
Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
operations.orderDetail(String orderRef): Future<Object?>Parameters
orderRefStringRequired- Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- commerce_identity_required
- commerce_unavailable
- not_found
createCommerceProposal
Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
operations.createCommerceProposal({required String storeReference, required String orderReference, required String idempotencyKey}): Future<Object?>Parameters
storeReferenceStringRequired- Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
orderReferenceStringRequired- Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
idempotencyKeystring (16-128 characters)Required- Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- commerce_identity_required
- commerce_unavailable
- shopify_reconnect_required
- shopify_rate_limited
- idempotency-conflict
confirmCommerceProposal
Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
operations.confirmCommerceProposal(String proposalId, String idempotencyKey): Future<Object?>Parameters
proposalIdStringRequired- Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
idempotencyKeystring (16-128 characters)Required- Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- commerce_identity_required
- commerce_unavailable
- shopify_reconnect_required
- shopify_rate_limited
- not_found
- idempotency-conflict
commerceProposal
Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
operations.commerceProposal(String proposalId): Future<Object?>Parameters
proposalIdStringRequired- Reads scoped order data and creates, confirms or reads a bounded Shopify order-cancellation proposal.
- Returns
- Future<Object?>
- Errors
- field-invalid
- network
- http
- session-expired
- commerce_identity_required
- commerce_unavailable
- not_found
DobroDeskClientToolRequest
Requests an allowlisted client tool, acknowledges its result or reads its status. Tool payloads are flat, bounded and reject sensitive field names.
{ toolName: String; basisMessageId: String; input: Map<String, Object?> }DobroDeskClientToolResult
Requests an allowlisted client tool, acknowledges its result or reads its status. Tool payloads are flat, bounded and reject sensitive field names.
{ callId: String; output: Map<String, Object?> }DobroDeskAttachmentDescriptor
Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
{ clientId: String; fileName: String; mimeType: String; sizeBytes: int; kind: String (image|video|pdf|text) }DobroDeskUploadIntent
Creates upload intents and uploads selected local files under the SDK size, type, URI and policy limits.
{ clientId: String; attachmentId: String; uploadUrl: String; uploadToken: String; expiresAt: String }DobroDeskLoadingState
The shared loading state is one of idle, starting-session, loading-messages, sending-message, waiting-for-assistant, executing-action, reconnecting or flushing-outbox.
"idle" | "starting-session" | "loading-messages" | "sending-message" | "waiting-for-assistant" | "executing-action" | "reconnecting" | "flushing-outbox"DobroDeskEvent
Native and wrapper events use the shared loading, session, snapshot, accepted-message, error and session-cleared envelope.
loading(state: DobroDeskLoadingState) | session-cleared | session-started | snapshot | message-accepted | error | host-action-requested | host-action-cancelleddispose
Stops optional capability work and releases its host resources.
dispose(): Future<void>Widget presentation
WidgetExperience (JSON schema)
The shared appearance-v2 object: colors, typography, layout and shadow within documented bounds.
schemaVersion, locale, appearance, platformOverrides, presentation, reducedMotion, copy- Errors
- field-invalid
- unsupported
DobroDeskWidgetView
Presents the native widget using the shared widget experience.
DobroDeskWidgetView({ required DobroDeskFlutterClient client, NativeWidgetOptions options = const NativeWidgetOptions(), bool visible = true, onError?, errorBuilder? })beginInlineWidget
Presents the native widget using the shared widget experience.
beginInlineWidget(NativeWidgetOptions options, String ownerId): Future<void>- Errors
- invalid-config
- request-in-progress
- field-invalid
mountInlineWidget
Presents the native widget using the shared widget experience.
mountInlineWidget(String ownerId): Future<void>- Errors
- invalid-config
- request-in-progress
- field-invalid
disposeInlineWidget
Closes the current native presentation or releases a mounted host.
disposeInlineWidget(String ownerId): Future<void>NativeOperation (wrapper bridge)
Exposes typed form, client-tool, attachment and commerce operations over the native engine.
operation: "complete-host-action" | "request-client-tool" | "complete-client-tool" | "client-tool-status" | "submit-form" | "procedure-action" | "attachment-intents" | "upload-attachment" | "list-orders" | "order-detail" | "create-commerce-proposal" | "confirm-commerce-proposal" | "commerce-proposal"complete-host-action (local bridge)
Framework wrappers encode host-action completion through a local native presenter bridge. It is not sent as an HTTP operation through the direct native client.
{ operation: "complete-host-action"; requestId: string; actionId: string; result: HostActionResult }Parameters
requestIdstringRequired- Allowlisted application callbacks for guided widget actions. They do not authenticate network requests.
actionIdstringRequired- Allowlisted application callbacks for guided widget actions. They do not authenticate network requests.
resultHostActionResultRequired- Allowlisted application callbacks for guided widget actions. They do not authenticate network requests.
- Returns
- JsonValue
- Errors
- field-invalid
- session-expired
- unsupported
Optional capabilities
attachVoice
Attaches a separately installed, host-owned voice capability.
attachVoice(DobroDeskVoicePort port): Future<DobroDeskVoiceFacade>- Errors
- unsupported
- invalid-config
voice
Controls an optional host-installed voice capability: start, stop, mute, barge-in and disposal. The browser widget may render voice UI, but this SDK API controls only a host-provided voice bridge.
voice: DobroDeskVoiceFacade?voice lifecycle
Controls an optional host-installed voice capability: start, stop, mute, barge-in and disposal. The browser widget may render voice UI, but this SDK API controls only a host-provided voice bridge.
start(): Future<void>; stop(): Future<void>; setMuted(bool muted): Future<void>; bargeIn(): Future<void>; dispose(): Future<void>- Errors
- invalid-configuration
- permission-denied
- audio-unavailable
- session-expired
- realtime-unavailable
- invalid-response
- protocol-violation
- stale-frame
- queue-overloaded
- cancelled
- unsupported
push module (native only)
Describes the separate opt-in native push artifact and host registration flow. Framework wrappers do not export a JavaScript or Dart push client; use the iOS or Android native module.
No JS/Dart wrapper export; use the iOS DobroDeskPush product or Android com.dobrodesk:dobrodesk-push:<version>.Errors
DobroDeskException
Handle stable machine-readable codes and keep server diagnostics out of customer UI.
DobroDeskException(String code, String message, { int? status, int? retryAfterSeconds, String? fieldId, String? requestId }); code: String- Errors
- invalid-config
- network
- http
- integration-disabled
- integration-paused
- origin-not-allowed
- turnstile-required
- turnstile-failed
- request-in-progress
- idempotency-conflict
- conversation-limit-reached
- rate-limited
- payload-too-large
- field-invalid
- conversation-stale
- session-expired
- realtime-unavailable
- message-rejected
- outbox-corrupt
- unsupported