salsify-experiences-sdk
Version:
SDK to be used by commerce websites to implement product experiences.
64 lines (61 loc) • 2.24 kB
text/typescript
// Options are specified during initialization and get merged with defaults to become more
// strictly typed Settings found in ./settings.ts
/** The settings interface for initializing the SDK. */
export default interface SdkOptions {
/**
* Client identifier provided by Salsify that uniquely identifies your website
* or family of websites
*
* @example "s-00000000-00000000-00000000-00000000"
*/
readonly clientId: string
/**
* Locale identifier that determines the language of the page content
*
* If you need to change the language after initialization without reloading
* the page (e.g. based on user selection), you may
* {@link "enhancedContent".EnhancedContentApi.updateLanguageCode | update the language code}
*
* @defaultValue `en-US`
*
* @example "fr-CA"
*/
readonly languageCode?: string
/** Settings for initializing Enhanced Content
*
* See {@link EnhancedContentOptions | definition} for more information
*/
readonly enhancedContent?: EnhancedContentOptions
/**
* Whether or not cookie-based user tracking should be enabled
*
* The host site (i.e. your site) is responsible for displaying any user consent
* dialogs and setting this option based on the user's preference
*
* @defaultValue `true`
*/
readonly tracking?: boolean
/** @internal */
readonly staging?: boolean
/** @internal */
readonly cdnRoot?: string
}
/** The settings interface for the Enhanced Content (EC) API */
export interface EnhancedContentOptions {
/** Default product identifier type that will be used when requesting EC
*
* This ID type will be used to correlate Salsify-published EC with products on your website
*
* This is often a standardized identifier such as a UPC (GTIN-12) or EAN (GTIN-13), or your website’s product SKU
*
* In the event that your site supports two or more ID types, this default value may
* be overridden in each request to render EC, for example by submitting a value for the
* `idType` optional parameter in the
* {@link "enhancedContent".EnhancedContentApi.renderIframe | call to `renderIframe`}
*
* @defaultValue `SDKID`
*
* @example "SKU"
*/
readonly idType?: string
}