Class Config

The top-level class for configuring and initializing a TikiSdk instance.

Hierarchy

  • Config

Constructors

Accessors

  • get activeTheme(): Theme
  • The active Theme depending on the user's configuration

    Defaults to light if a dark theme has not been set.

    Returns Theme

    See

    dark

  • get dark(): Theme
  • A Theme object for pre-built UIs with a dark mode appearance.

    The dark mode theme is applied to the UI elements only when explicitly called. By default, the dark mode theme is identical to the default (light) theme. Each individual property of the dark mode theme can be customized during configuration.

    Returns Theme

  • get offer(): Offer
  • Creates a new, empty Offer object.

    This Offer object can be used to define a new offer before adding it to the TIKI SDK. To add the offer, call the add method on the Offer object.

    Returns Offer

Methods

  • Adds an Offer object to the offers list.

    Currently only a single offer is supported in TIKI's pre-built UI.

    Parameters

    • offer: Offer

      The Offer object to add to the offers list.

    Returns Config

  • Disables or enables the ending UI for accepted offers.

    If this method is called with a parameter value of true, the ending UI will not be shown when an offer is accepted. If the parameter value is false, the ending UI will be shown as usual.

    Parameters

    • disable: boolean = false

      A Boolean value indicating whether the ending UI for accepted offers should be disabled (true) or enabled (false).

    Returns Config

  • Disables or enables the ending UI for declined offers.

    If this method is called with a parameter value of true, the ending UI will not be shown when an offer is declined. If the parameter value is false, the ending UI will be shown as usual.

    Parameters

    • disable: boolean = false

      A Boolean value indicating whether the ending UI for declined offers should be disabled (true) or enabled (false).

    Returns Config

  • Initializes the TIKI SDK.

    Use this method to initialize the TIKI SDK with the specified publishingId, id, and origin.

    Parameters

    • publishingId: string

      The publishingId is required for connecting to TIKI's services. Get a free publishingId at console.mytiki.com.

    • id: string

      The ID that uniquely identifies your user.

    • Optional origin: string

      The default origin for all transactions. Defaults to window.location.hostname if undefined.

    Returns Promise<void>

  • Sets the callback function for when an offer is accepted.

    This method sets the onAccept event handler, which is triggered when the user accepts a licensing offer.

    Parameters

    • callback: ((offer, license) => void)

      The closure to be executed when an offer is declined. The closure takes two arguments: the Offer that was accepted, and the LicenseRecord object containing the license information for the accepted offer.

    Returns Config

  • Sets the callback function for when an offer is declined.

    This method sets the onDecline event handler, which is triggered when the user declines a licensing offer. The event is triggered either when the user selects "Back Off" or "Opts Out" in settings.

    Parameters

    • callback: ((offer, license?) => void)

      The closure to be executed when an offer is declined. The closure takes two arguments: the Offer that was declined, and an optional LicenseRecord object containing the license information for the declined offer, if it was previously accepted.

        • (offer, license?): void
        • Parameters

          Returns void

    Returns Config

  • Sets the callback function for when the user selects "settings" in the ending widget. This method sets the onSettings() event handler, which is triggered when the user selects "settings" in the ending screen. If a callback function is not registered, the SDK will default to calling the TikiSdk.settings() method.

    Parameters

    • callback: (() => void)

      The closure to be executed when the "settings" option is selected. The closure takes no arguments and returns no value.

        • (): void
        • Returns void

    Returns Config