Function config

  • Starts the configuration process for the Tiki SDK.

    This method returns the shared instance of Config, which can be used to configure the SDK before initializing it. You can access child configurations such as Theme or Offer, and call methods such as disableAcceptEnding and onAccept on the returned instance to customize the SDK behavior to your needs.

    After the configuration is complete, you initialize the SDK by calling initialize.

    To configure the Tiki SDK, you can use the builder pattern and chain the methods to customize the SDK behavior as needed. Here's an example:

    TikiSdk.config()
    .theme
    .primaryTextColor('#000000')
    .primaryBackgroundColor('#FFFFFF')
    .accentColor('green')
    .and()
    .dark
    .primaryTextColor('white')
    .primaryBackgroundColor('black')
    .accentColor('green')
    .and()
    .offer
    .bullet({ text: 'Use for ads', isUsed: true })
    .bullet({ text: 'Share with 3rd party', isUsed: false })
    .bullet({ text: 'Sell to other companies', isUsed: true })
    .ptr('offer1')
    .use({ usecases: [TikiSdk.LicenseUsecase.custom('example')] })
    .tag(TitleTag(TitleTagEnum.advertisingData))
    .duration(365 * 24 * 60 * 60)
    .terms('./terms.md')
    .add()
    .onAccept ((offer, license) => console.log('accepted))
    .onDecline ((offer, license) => console.log('declined))
    .disableAcceptEnding(false)
    .disableDeclineEnding(true)
    .initialize('publishingId', 'userId')

    Returns Config