Optionally, you can add apiVersion
to the client options if you want to use a specific API version.
const voucherify = VoucherifyServerSide({
applicationId: 'YOUR-APPLICATION-ID',
secretKey: 'YOUR-SECRET-KEY',
apiVersion: 'v2017-04-20'
})
Log-in to Voucherify web interface and obtain your Application Keys
from Configuration:
const voucherify = VoucherifyServerSide({
applicationId: 'YOUR-APPLICATION-ID',
secretKey: 'YOUR-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({
applicationId: 'YOUR-APPLICATION-ID',
secretKey: 'YOUR-SECRET-KEY',
customHeaders: {
"DEBUG-HEADER": "my_value",
"TEST-HEADER": "another_value"
}
})
Set this option to disable displaying the warning about exposing your secretKey
if you're using VoucherifyServerSide in a browser environment.
By setting this option to true
, you acknowledge that you understand the risks of exposing your secretKey
to a browser environment.
const voucherify = VoucherifyServerSide({
applicationId: 'YOUR-APPLICATION-ID',
secretKey: 'YOUR-SECRET-KEY',
dangerouslySetSecretKeyInBrowser: true
})
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
Log-in to Voucherify web interface and obtain your Application Keys
from Configuration:
const voucherify = VoucherifyServerSide({
applicationId: 'YOUR-APPLICATION-ID',
secretKey: 'YOUR-SECRET-KEY'
})
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.
Optionally, you can add
apiUrl
to the client options if you want to use Voucherify running in a specific region.