periculum_identity_sdk 0.1.0
periculum_identity_sdk: ^0.1.0 copied to clipboard
Periculum Insights identity comparison SDK — guided face liveness capture and Dikript-backed ID verification.
periculum_identity_sdk #
Flutter SDK for Periculum Insights identity comparison: guided face liveness (ML Kit) + server-side Dikript identity match (BVN, NIN, PHONENUMBER, FRSC).
Install #
dependencies:
periculum_identity_sdk:
path: ../periculum_identity_sdk # or pub.dev once published
Platform setup #
- Android / iOS: follow
cameraandgoogle_mlkit_face_detectionsetup (permissions, min SDK).
Authentication #
Use the same OAuth Bearer token you already use for Insights API calls (Keycloak client credentials / user token). The SDK does not embed API keys; your backend tenant wallet is debited on successful 200 responses, same as BVN verify.
Usage #
A — Business fixes ID type and number (customer only does face scan) #
final result = await client.verifyWithConfig(
context: context,
config: IdentityVerificationConfig(
fixedIdType: DikriptIdentityType.bvn,
fixedIdNumber: '22222222222',
),
);
B — Business fixes BVN only; customer enters their BVN #
final result = await client.verifyWithConfig(
context: context,
config: IdentityVerificationConfig(
fixedIdType: DikriptIdentityType.bvn,
allowedIdTypes: [DikriptIdentityType.bvn],
),
);
C — Customer chooses from Dikript types your product allows #
final result = await client.verifyWithConfig(
context: context,
config: IdentityVerificationConfig(
allowCustomerToChooseIdType: true,
allowedIdTypes: [
DikriptIdentityType.bvn,
DikriptIdentityType.nin,
], // or omit and call fetchIdTypeOptions() for tenant defaults
),
);
Liveness #
The SDK runs active liveness (ML Kit): single-face checks, distance hints, center → blink → head turn, accurate post-capture face validation — not a gallery pick.
final client = PericulumIdentityClient(
baseUrl: 'https://insights-api.aws.insights-periculum.com',
accessTokenProvider: () async => myInsightsBearerToken,
livenessConfig: const FaceLivenessConfig(stepTimeout: Duration(seconds: 60)),
);
API #
| Method | Insights endpoint |
|---|---|
verifyIdentity |
PUT /verify/identity-comparison (multipart/form-data: file, idType, idNumber, optional statementKey) |
Webhooks #
When webhooks are enabled on your tenant, a successful match triggers an encrypted webhook with responseType: IDENTITY_COMPARISON and identityComparisonResponse payload (match score + Dikript identity payload).
Publish to pub.dev #
cd frontend/periculum_identity_sdk
dart pub publish --dry-run
dart pub publish
Ops #
- Run DB migration
@113_PSSP-identity-comparison-dikript.psqlon tenant Postgres. - Add to GCP Secret Manager (Insights API secret JSON):
DikriptSecretKey, optionalDikriptBaseUrl,DikriptMinimumConfidence. - Configure wallet pricing for endpoint
IDENTITY_COMPARISON_VERIFICATION.