Skip to content

KYC & Identity Verification

For casino compliance, users must complete Know Your Customer (KYC) verification. The SDK tracks this status on the User object (user.kycStatus) and gates compliance-sensitive actions on it.

KYC state machine

StateEntry triggerAllowed transitionsSide effects
UNVERIFIEDAccount creationPENDING (user submits documents)Default state; KYC-gated actions forbidden
PENDINGsubmitKyc succeedsVERIFIED (review approved) · → REJECTED (review declined)Optimistic UI update + onAuthStateChanged; KYC-gated actions still forbidden
VERIFIEDReview approvedterminalAll platform features available
REJECTEDReview declinedPENDING (user resubmits documents)User must resubmit; resubmission always returns to PENDING; never directly to VERIFIED

Undocumented transitions are forbidden by definition. Only the platform's review process moves PENDING → VERIFIED/REJECTED; only the user moves UNVERIFIED/REJECTED → PENDING.

Submitting KYC Documents

Pass the document type and base64-encoded images to the SDK:

javascript
const frontImageBase64 = await fileToBase64(fileInputFront.files[0]);
const backImageBase64 = await fileToBase64(fileInputBack.files[0]);

await sdk.auth.submitKyc({
  documentType: 'PASSPORT', // 'PASSPORT' | 'DRIVERS_LICENSE' | 'ID_CARD'
  frontImage: frontImageBase64,
  backImage: backImageBase64
});

KycSubmission interface

typescript
interface KycSubmission {
  documentType: 'PASSPORT' | 'DRIVERS_LICENSE' | 'ID_CARD'; // document category
  frontImage: string;  // base64-encoded image of the document front (required)
  backImage: string;   // base64-encoded image of the document back (required)
}
text
GIVEN a logged-in user with kycStatus UNVERIFIED or REJECTED
WHEN submitKyc(submission) is called with valid images
THEN kycStatus becomes PENDING, the user object updates,
     and onAuthStateChanged fires immediately (optimistic UI).

Sandbox controls

In sandbox, the review outcome is simulated manually:

javascript
await sdk.auth.sandbox?.approveKyc(); // PENDING → VERIFIED
await sdk.auth.sandbox?.rejectKyc();  // PENDING → REJECTED

Both controls operate on the current sandbox user and are null outside sandbox.

KYC errors

See the auth error table; KYC-gated actions elsewhere in the platform fail with FORBIDDEN (403) while the user is not VERIFIED.