Reference / @getenginex/sdk / KycApi
KycApi
The player's identity verification (KYC): query the status and send documents for the operator's manual review. All methods require login. There is no real-time notice of a status change: query KycApi.getStatus again (e.g. when opening the screen or on an interval).
Methods
getStatus()
getStatus(
params?,options?):Promise<KycStatus>
Status of the logged-in player's verification.
Parameters
params?
options?
Returns
Promise<KycStatus>
Example
const kyc = await enginex.kyc.getStatus()
if (kyc.status === 'rejected') showRejection(kyc.rejectionReason ?? 'Send the documents again')Throws
UNAUTHENTICATED without a session; VALIDATION_ERROR with validation: 'strict' if the gateway sends a level or status that the SDK does not know, or an updated_at that is not a date.
uploadDocument()
uploadDocument(
input,options?):Promise<KycDocumentUpload>
Sends a document for review (multipart: document_type + file). The review is manual: after the upload, track it with KycApi.getStatus until approved or rejected. It is not idempotent (the gateway does not protect it): on a network failure, check the status before resending. The client's hooks receive only the file's name, type and size, never the content.
Parameters
input
options?
Returns
Promise<KycDocumentUpload>
Example
const [file] = input.files ?? []
if (file) await enginex.kyc.uploadDocument({ documentType: 'rg_front', file })Throws
CONFIGURATION_ERROR (without a request) for a documentType outside the list or a file that is not a Blob/File; INVALID_ARGUMENT (400) if the gateway cannot read the multipart or the file (file too large or invalid format, file is required, failed to read file) or refuses the type; RESOURCE_EXHAUSTED (429) for a file too large for the compliance service or a request limit; compliance service errors passed through by code (some as HTTP 500); UNKNOWN with status 201 if the gateway answers without confirming receipt (success: false or no id; message is the gateway's when present, otherwise the SDK's). General rule: UNKNOWN with a 2xx status = operation not confirmed: reread the state (KycApi.getStatus) before trying again. UNAUTHENTICATED without a session. validation: 'warn' does not apply to that confirmation (success): an unconfirmed upload always rejects with UNKNOWN.