SDK Methods
This page documents all public methods available on the PixFace SDK instance.
mount
Initializes and mounts the SDK on the DOM. This method must be called after creating the SDK instance and before any other operation.
Type: Function
Returns: Promise<void>
const sdk = PixFace({
apiURL: "https://api.dev.pixtopay.com",
api_key: "pk_dev_xxxxxxxxx",
integrationId: "sua-integration-id",
});
sdk.mount().then(() => {
console.log("SDK montado com sucesso!");
});verifyDocument
Starts the standard flow.
Type: Function
Parameters: Object
Returns: Promise<void>
sdk.verifyDocument({
cpf: "12345678900",
referenceId: "order-123",
action: "signup",
});Parameters:
| Name | Type | Description | Required |
|---|---|---|---|
cpf | string | User's CPF (numbers only or formatted) | Yes |
referenceId | string | Reference ID for tracking | No |
action | string | Name of the action being executed | No |
startFaceIndex
Starts the Liveness flow.
Type: Function
Parameters: Object
Returns: Promise<void>
sdk.startFaceIndex({
cpf: "12345678900",
referenceId: "user-456",
});Parameters:
| Name | Type | Description | Required |
|---|---|---|---|
cpf | string | User's CPF (numbers only or formatted) | Yes |
referenceId | string | Reference ID for tracking | No |
openVerifySOWFlow
Starts the Source of Wealth flow.
Type: Function
Parameters: Object
Returns: Promise<void>
sdk.openVerifySOWFlow({
cpf: "12345678900",
referenceId: "transaction-789",
});Parameters:
| Name | Type | Description | Required |
|---|---|---|---|
cpf | string | User's CPF (numbers only or formatted) | Yes |
referenceId | string | Reference ID for tracking | No |
closeModal
Closes the verification modal and clears the iframe src.
Type: Function
Returns: void
sdk.closeModal();setLang
Changes the verification flow language. Currently ignored by the front-end.
Type: Function
Parameters: string
Returns: void
sdk.setLang("en");
sdk.setLang("pt");checkCPF
Validates whether a CPF is valid.
Type: Function
Parameters: string
Returns: boolean
const isValid = sdk.checkCPF("123.456.789-09");
console.log(isValid); // true
const isInvalid = sdk.checkCPF("000.000.000-00");
console.log(isInvalid); // false
const alsoValid = sdk.checkCPF("12345678909"); // aceita com ou sem formataçãoSee Also
- Configuration Options - All available options when initializing the SDK
- Fields and Actions - Default field and action IDs
- Features - Detailed documentation of each feature