TryNow JavaScript SDK

TryNow

The public TryNow interface. Accessible via window.trynow.
This class exposes public SDK methods for interacting with the TryNow Shopify Integration.

Kind: global class

tryNow.initialize(config) ⇒ TryNow

Initializes TryNow. This can be called manually or will automatically initialize when TryNow is enabled via the App Embed block in the Shopify Theme Customizer.

Kind: instance method of TryNow
Returns: TryNow - the initialized TryNow instance

ParamTypeDescription
configTryNowInitConfigoptions

tryNow.reset()

Restart the TryNow Components registers

Kind: instance method of TryNow

tryNow.getMyshopifyDomain() ⇒ string

Gets the myshopify domain of the store.

Kind: instance method of TryNow
Returns: string - domain

tryNow.getVersion() ⇒ string

Gets the SDK version. Tries to find from app embed settings, otherwise uses the version set in the config.

Kind: instance method of TryNow
Returns: string - version

tryNow.getTrialPeriodDays() ⇒ Promise.<number>

Gets the number of trial period days.

Kind: instance method of TryNow
Returns: Promise.<number> - days

tryNow.getSellingPlanId() ⇒ Promise.<string>

Gets the selling plan ID number as a string.

Kind: instance method of TryNow
Returns: Promise.<string> - selling plan ID