Skip to main content

API Reference

Complete reference for the Azakaw Flutter SDK (azakaw_kyc_flutter).

AzakawKyc.start​

static Future<AzakawKycResult> start({
required BuildContext context,
required AzakawKycConfig config,
AzakawKycResultCallback? onComplete,
AzakawKycResultCallback? onCancel,
AzakawKycErrorCallback? onError,
AzakawExternalUrlCallback? onExternalUrl,
Widget? loadingIndicator,
})

Presents the onboarding flow and resolves once the user leaves it.

ParameterTypeDescription
contextBuildContextUsed to push the route.
configAzakawKycConfigSee Configuration.
onCompletevoid Function(AzakawKycResult)?Called on successful completion.
onCancelvoid Function(AzakawKycResult)?Called when the user backs out.
onErrorvoid Function(AzakawKycException)?Called when the portal fails to load.
onExternalUrlvoid Function(Uri)?Called for non-http(s) links the WebView will not open.
loadingIndicatorWidget?Replaces the default spinner.

AzakawKycConfig​

See Configuration for the full option table.

MemberTypeDescription
isUnavailableCombinationbooltrue for a sandbox pairing with no provisioned host (KSA, Qatar).
copyWith(...)AzakawKycConfigReturns a copy with the given fields replaced.

AzakawTenantResolver​

static Future<AzakawTenantResolution> resolve({
required String authUrl,
required String sessionId,
required String regionName,
required String environmentName,
http.Client? client,
Duration timeout = const Duration(seconds: 4),
})

Looks the session up before the first page load. Called automatically when resolveTenantHost is on; exposed for hosts that want to resolve the domain themselves. See Tenant domains.

AzakawTenantResolution​

MemberTypeDescription
hostString?Tenant hostname from the token's baseUrl claim, when there is one.
sessionErrorAzakawKycException?Set when the backend rejected the session (401/403/404) — almost always the wrong region or environment.
isRejectedboolWhether sessionError is set.

A rejection fails the flow with a clear message rather than loading the portal, which would otherwise fall back to its login screen and look like an SDK fault. Server-side failures (5xx), timeouts and malformed responses are not rejections: the flow loads the region host as normal.

decodeJwtPayload(String? jwt) returns a token's claims without verifying its signature, or null if it is not a readable JWT.

Enums​

AzakawRegion​

ValuewireNamedomainProductionSandbox
AzakawRegion.uaeUAEazakaw.comappsandbox
AzakawRegion.ksaKSAazakawksa.comapp—
AzakawRegion.qatarQatarazakawqatar.comapp—
AzakawRegion.kuwaitKuwaitazakaw.comkuwaitkuwait-stg
MemberTypeDescription
subdomainFor(AzakawEnvironment)String?Subdomain for that pairing; null when it is not provisioned.
hasSandboxboolWhether the region has a sandbox at all.

AzakawEnvironment​

ValuewireName
AzakawEnvironment.sandboxSandbox
AzakawEnvironment.productionProduction

The subdomain is not a property of the environment alone — see AzakawRegion.subdomainFor.

AzakawLanguage​

ValuecodeNotes
AzakawLanguage.enenLTR
AzakawLanguage.ararRTL

AzakawKycStatus​

ValueMeaning
completedThe portal reported OnboardingCompleted.
cancelledThe user backed out.
failedThe portal could not be loaded; see AzakawKycResult.error.

AzakawKycResult​

MemberTypeDescription
statusAzakawKycStatusHow the run ended.
sessionIdStringThe session the run was started with.
errorAzakawKycException?Set only when status is failed.
isCompleted / isCancelled / isFailedboolConvenience getters.

AzakawKycException​

MemberTypeDescription
messageStringWhat went wrong.
statusCodeint?Set when the failure was an HTTP error.
urlString?The URL being loaded at the time.

AzakawKycView​

The widget behind AzakawKyc.start, for embedding the flow in your own layout. See Usage.

PropertyTypeDescription
configAzakawKycConfigRequired.
onCompletedAzakawKycCompletedCallback? — void Function()Portal reported completion.
onCancelledAzakawKycCancelledCallback? — void Function()User confirmed closing.
onErrorAzakawKycErrorCallback? — void Function(AzakawKycException)Load failure.
onExternalUrlAzakawExternalUrlCallback? — void Function(Uri)Non-http(s) navigation.
loadingIndicatorWidget?Replaces the default spinner.

AzakawKycViewState.requestClose() shows the close confirmation and returns whether the user confirmed. When they confirm, it also calls onCancelled, so handle the navigation there rather than on the returned value.

URL helpers​

AzakawUrls resolveAzakawUrls({
required AzakawRegion region,
required AzakawEnvironment environment,
})

Returns baseUrl, apiUrl and authUrl for a pairing. See Configuration.

kAzakawPortalSdkVersion is the protocol version reported to the portal. It tracks the Web SDK's sdkVersion and is not the pub package version.

Events​

EventReturnsDescription
onCompleteAzakawKycResultFired when the user completes the onboarding.
onCancelAzakawKycResultFired when the user closes the flow.
onErrorAzakawKycExceptionFired when the portal cannot be loaded.