Log-in to Voucherify web interface and obtain your Client-side Keys
from Configuration:
const client = VoucherifyClientSide({
clientApplicationId: 'YOUR-CLIENT-APPLICATION-ID',
clientSecretKey: 'YOUR-CLIENT-SECRET-KEY'
})
Log-in to Voucherify web interface and obtain your Client-side Keys
from Configuration:
const client = VoucherifyClientSide({
clientApplicationId: 'YOUR-CLIENT-APPLICATION-ID',
clientSecretKey: 'YOUR-CLIENT-SECRET-KEY'
})
You can pass additional headers to requests made by the API Client. It can prove to be useful when debugging various scenarios.
const voucherify = VoucherifyServerSide({
clientApplicationId: 'YOUR-CLIENT-APPLICATION-ID',
clientSecretKey: 'YOUR-CLIENT-SECRET-KEY',
customHeaders: {
"DEBUG-HEADER": "my_value",
"TEST-HEADER": "another_value"
}
})
If you wish to include original Axios error in VoucherifyError instance set this to true It can prove to be useful when debugging various scenarios. The original Axios error will be included in cause property of VoucherifyError
(Required in Node.js) Set the origin from where the requests are made.
const client = VoucherifyClientSide({
clientApplicationId: 'YOUR-CLIENT-APPLICATION-ID',
clientSecretKey: 'YOUR-CLIENT-SECRET-KEY',
origin: 'your-domain.com'
})
Optionally, you can set timeout in miliseconds. After this time request will be aborted. By default Voucherify's API has timeout value of 3 minutes.
Set customer identity when using React Widget. In other situations, use setIdentity
method:
client.setIdentity('gustav@purpleson.com')
Optionally, you can add
apiUrl
to the client options if you want to use Voucherify running in a specific region.