Skip to main content

Interface: SlashIDOptions

Types.SlashIDOptions

This class simply holds connection options for your SlashID organization, to be passed to the SlashID constructor.

By default, the SDK will connect to the production environment and use the default SDK location:

const baseURL = "https://api.slashid.com"
const sdkURL = "https://cdn.slashid.com/sdk.html"

You can configure the SlashID SDK to connect to the sandbox environment instead:

Example

const sid = SlashID({
environment: "sandbox"
})

Alternatively, you can specify a custom environment:

Example

const sid = SlashID({
environment: {
baseURL: "https://api.custom.com",
sdkURL: "https://sdk.custom/path.html"
}
})

Remarks

Specifying options for SlashID is optional and only required in some cases:

  • if your Organization has custom WebAuthn scopes: use your SlashID-provided sdkURL value;
  • you are experimenting and want to connect to an environment other than production;
  • you want to enable analytics, in which case you must provide your Organization ID as the oid value

Properties

analyticsEnabled

Optional analyticsEnabled: boolean

Whether to enable analytics or not.

Default

true


baseURL

Optional baseURL: string

The base SlashID API endpoint.

Deprecated

Use the environment option instead.


environment

Optional environment: SlashIDEnvironment

The environment to connect to - either "production" or "sandbox".

Default

"production"

To use a custom environment, pass an object with the following shape:

Example

environment: {
baseURL: "https://{YOUR_CUSTOM_API_DOMAIN}}",
sdkURL: "https://{YOUR_CUSTOM_SDK_DOMAIN}}/sdk.html"
}

oid

Optional oid: string

Your Organization ID provided by SlashID


sdkURL

Optional sdkURL: string

The location where your organization's custom SDK is served.

Deprecated

Use the environment option instead.