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
- .reset()
- .getMyshopifyDomain() ⇒
string
- .getVersion() ⇒
string
- .getTrialPeriodDays() ⇒
Promise.<number>
- .getSellingPlanId() ⇒
Promise.<string>
- .initialize(config) ⇒
tryNow.initialize(config) ⇒ TryNow
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
Param | Type | Description |
---|---|---|
config | TryNowInitConfig | options |
tryNow.reset()
Restart the TryNow Components registers
Kind: instance method of TryNow
tryNow.getMyshopifyDomain() ⇒ string
string
Gets the myshopify domain of the store.
Kind: instance method of TryNow
Returns: string
- domain
tryNow.getVersion() ⇒ string
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>
Promise.<number>
Gets the number of trial period days.
Kind: instance method of TryNow
Returns: Promise.<number>
- days
tryNow.getSellingPlanId() ⇒ Promise.<string>
Promise.<string>
Gets the selling plan ID number as a string.
Kind: instance method of TryNow
Returns: Promise.<string>
- selling plan ID