Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface VoucherifyServerSideOptions

Hierarchy

  • VoucherifyServerSideOptions

Index

Properties

Optional apiUrl

apiUrl: string

Optionally, you can add apiUrl to the client options if you want to use Voucherify running in a specific region.

const voucherify = VoucherifyServerSide({
        applicationId: 'YOUR-APPLICATION-ID',
        secretKey: 'YOUR-SECRET-KEY',
        apiUrl: 'https://<region>.api.voucherify.io'
})

Optional apiVersion

apiVersion: string

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'
})

applicationId

applicationId: string

Log-in to Voucherify web interface and obtain your Application Keys from Configuration:

const voucherify = VoucherifyServerSide({
        applicationId: 'YOUR-APPLICATION-ID',
        secretKey: 'YOUR-SECRET-KEY'
})

Optional channel

channel: string

Optional customHeaders

customHeaders: Record<string, string>

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"
        }
})

Optional dangerouslySetSecretKeyInBrowser

dangerouslySetSecretKeyInBrowser: boolean

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
})

Optional exposeErrorCause

exposeErrorCause: boolean

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

secretKey

secretKey: string

Log-in to Voucherify web interface and obtain your Application Keys from Configuration:

const voucherify = VoucherifyServerSide({
        applicationId: 'YOUR-APPLICATION-ID',
        secretKey: 'YOUR-SECRET-KEY'
})

Optional timeoutMs

timeoutMs: number

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.