Skip to main content

initSecureFields

function initSecureFields(sdkConfiguration): Promise<SecureFieldsClient>;

Initializes the Secure Fields SDK with the provided tenant ID and configuration.

Parameters

ParameterTypeDescription
sdkConfiguration{ apiKey?: string; config: SecureFieldsConfig; tenantId: string; vault_vendor?: "purse" | "pci_proxy"; }-
sdkConfiguration.apiKey?stringApi key provided by Purse for gateway access
sdkConfiguration.configSecureFieldsConfigConfiguration for the secure fields. See SecureFieldsConfig for supported options.
sdkConfiguration.tenantIdstringYour tenant ID provided by Purse. *
sdkConfiguration.vault_vendor?"purse" | "pci_proxy"-

Returns

Promise<SecureFieldsClient>

A promise that resolves to an instance of the SDK identified for the tenantId.

Throws

SdkError Throws an error if initialization parameters are invalid. Possible errors include:

Error Code
INIT_FAILED
TENANT_ID_REQUIRED
FIELD_CONFIG_REQUIRED
FIELD_TARGET_INVALID
NOT_SUPPORTED_FIELD

See

SecureFieldsErrors