@getsupertab/supertab-js 3.53.1 → 3.53.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,32 +5,46 @@ This package allows [Supertab.js](https://docs.supertab.co/) to be imported as a
5
5
  [![npm version](https://img.shields.io/npm/v/@getsupertab/supertab-js.svg?style=flat-square)](https://www.npmjs.com/package/@getsupertab/supertab-js)
6
6
  ## Installation
7
7
 
8
- Use `npm` to install the Supertab.js module:
8
+ Install Supertab.js from npm::
9
9
 
10
10
  ```sh
11
11
  npm install @getsupertab/supertab-js
12
12
  ```
13
13
 
14
- ## Usage Example
14
+ Import, load and initialize the client in your application:
15
+
16
+ ```javascript
17
+ import { loadSupertab } from "@getsupertab/supertab-js";
15
18
 
16
- Run the following code in a browser environment, it won't work on the server-side.
19
+ (async () => {
20
+ const { Supertab } = await loadSupertab();
21
+ const supertabClient = new Supertab({ clientId: "test_client.X" });
22
+ })();
23
+ ```
24
+
25
+ `loadSupertab()` loads the latest compatible Supertab.js version from our CDN. It must be called in a browser environment—it won't work server-side.
26
+
27
+ ## Usage Example
17
28
 
18
29
  ```javascript
19
- import Supertab from "@getsupertab/supertab-js";
30
+ import { loadSupertab } from "@getsupertab/supertab-js";
20
31
 
21
- const supertab = new Supertab({
22
- clientId: "client.xyz",
23
- });
32
+ (async () => {
33
+ const { Supertab } = await loadSupertab();
34
+ const supertabClient = new Supertab({
35
+ clientId: "client.xyz",
36
+ });
24
37
 
25
- const { show } = supertab.createPaywall({
26
- experienceId: "experience.xyz",
27
- });
38
+ const { show } = await supertabClient.createPaywall({
39
+ experienceId: "experience.xyz",
40
+ });
28
41
 
29
- const paywallResult = await show();
30
- console.log(paywallResult);
42
+ const paywallResult = await show();
43
+ console.log(paywallResult);
44
+ })();
31
45
  ```
32
46
 
33
- This example creates a new Supertab.js instance using the `new Supertab()` constructor.
47
+ This example loads Supertab and creates a new Supertab.js instance using the `new Supertab()` constructor.
34
48
  Then, the `createPaywall` method is used to create a new paywall.
35
49
  The `show` function renders the paywall. Finally, once the user has completed or cancelled the purchase,
36
50
  we print the result data to the browser console.
@@ -1,4 +1,4 @@
1
- import { c as R, g as z } from "./index-BvMQqgO0.js";
1
+ import { c as R, g as z } from "./index-r__jBsqX.js";
2
2
  function X(w, d) {
3
3
  for (var b = 0; b < d.length; b++) {
4
4
  const y = d[b];
@@ -4167,7 +4167,7 @@ const UH = pr({
4167
4167
  VITE_STATIC_REDIRECT_URI: void 0,
4168
4168
  VITE_GTM_CONTAINER_ID: "GTM-NG9GT7FM",
4169
4169
  VITE_SENTRY_DSN: "https://d08f3f301f364ceba6345c393c538faf@o23455.ingest.us.sentry.io/4507736861573120",
4170
- VITE_BASE_URL: "https://js.supertab.co/v3.53.1/",
4170
+ VITE_BASE_URL: "https://js.supertab.co/v3.53.2/",
4171
4171
  VITE_DEMO_CLIENT_ID: void 0,
4172
4172
  VITE_API_BASE_URL: void 0,
4173
4173
  VITE_SSO_BASE_URL: void 0,
@@ -4176,13 +4176,13 @@ const UH = pr({
4176
4176
  VITE_CHECKOUT_URL: void 0,
4177
4177
  TAPPER_ENV: "prod",
4178
4178
  PACKAGE_NAME: "@getsupertab/supertab-js",
4179
- PACKAGE_VERSION: "3.53.1",
4179
+ PACKAGE_VERSION: "3.53.2",
4180
4180
  MONETIZATION_PROVIDER_SCRIPT_URL: void 0,
4181
4181
  VITE_POSTHOG_API_HOST: void 0,
4182
4182
  VITE_POSTHOG_API_KEY: void 0
4183
4183
  }), Z2 = async (t) => {
4184
4184
  if (VH) {
4185
- const { captureException: e } = await import("./sentry-CdDRA23r.js");
4185
+ const { captureException: e } = await import("./sentry-BhHX203q.js");
4186
4186
  e(t);
4187
4187
  }
4188
4188
  }, k8 = RE === "ctl" || RE === "sbx" || RE === "stg" ? !0 : RE === "prod" && typeof window < "u" && window.location ? new URLSearchParams(window.location.search).has("supertab-enable-logging") : !1, Ht = {
@@ -73220,7 +73220,7 @@ typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObje
73220
73220
  typeof Ob != "function" && (Ob = void 0);
73221
73221
  if (!Ob && !t3 && !s6)
73222
73222
  try {
73223
- import("./browser-ponyfill-BjsNP2m-.js").then((t) => t.b).then(function(t) {
73223
+ import("./browser-ponyfill-DLEgFbYS.js").then((t) => t.b).then(function(t) {
73224
73224
  Ob = t.default;
73225
73225
  }).catch(function() {
73226
73226
  });
@@ -1,4 +1,4 @@
1
- import { r as Nu, T as Ou, P as Lu, a as Du, V as Pu } from "./index-BvMQqgO0.js";
1
+ import { r as Nu, T as Ou, P as Lu, a as Du, V as Pu } from "./index-r__jBsqX.js";
2
2
  const T = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, F = globalThis, ft = "10.32.1";
3
3
  function bt() {
4
4
  return mr(F), F;
@@ -1,4 +1,4 @@
1
- import { S as e, l as o } from "./index-BvMQqgO0.js";
1
+ import { S as e, l as o } from "./index-r__jBsqX.js";
2
2
  export {
3
3
  e as Supertab,
4
4
  o as loadSupertab
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "access": "public",
20
20
  "registry": "https://registry.npmjs.org/"
21
21
  },
22
- "version": "3.53.1",
22
+ "version": "3.53.2",
23
23
  "type": "module",
24
24
  "scripts": {
25
25
  "dev": "vite --config .vite/vite.dev.config.ts",