@whop/checkout 0.0.24 → 0.0.25

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
@@ -10,7 +10,7 @@ To embed checkout, you need to add the following script tag into the `<head>` of
10
10
  <script
11
11
  async
12
12
  defer
13
- src="https://cdn.jsdelivr.net/npm/@whop/checkout/dist/loader.js"
13
+ src="https://js.whop.com/static/checkout/loader.js"
14
14
  ></script>
15
15
  ```
16
16
 
@@ -65,7 +65,7 @@ This can be used to attach metadata to a checkout by first creating a session th
65
65
  <script
66
66
  async
67
67
  defer
68
- src="https://cdn.jsdelivr.net/npm/@whop/checkout@0.0.21-canary.8/dist/loader.js"
68
+ src="https://js.whop.com/static/checkout/loader.js"
69
69
  ></script>
70
70
  <title>Whop embedded checkout example</title>
71
71
  <style>
@@ -80,7 +80,7 @@ This can be used to attach metadata to a checkout by first creating a session th
80
80
  <body>
81
81
  <div
82
82
  data-whop-checkout-plan-id="plan_XXXXXXXXX"
83
- data-whop-checkout-session-id="ch_XXXXXXXXX"
83
+ data-whop-checkout-session-id="ch_XXXXXXXXX"
84
84
  data-whop-checkout-theme="light"
85
85
  style="height: fit-content; overflow: hidden; max-width: 50%;"
86
86
  ></div>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whop/checkout",
3
3
  "description": "Embed Whop checkout on any website",
4
- "version": "0.0.24",
4
+ "version": "0.0.25",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/whopio/whop-sdk-ts",
@@ -22,15 +22,16 @@
22
22
  "files": [
23
23
  "dist"
24
24
  ],
25
+ "exports": {
26
+ ".": "./dist/static/checkout/index.js",
27
+ "./loader": "./dist/static/checkout/loader.js"
28
+ },
25
29
  "devDependencies": {
26
30
  "@swc/core": "1.11.29",
27
31
  "@types/node": "latest",
28
- "concurrently": "9.1.2",
29
- "dotenv": "16.5.0",
30
- "serve": "14.2.4",
31
- "ts-proto": "2.7.1",
32
32
  "tsup": "8.5.0",
33
- "typescript": "latest"
33
+ "typescript": "latest",
34
+ "wrangler": "^4.19.1"
34
35
  },
35
36
  "engines": {
36
37
  "node": "22.x",
@@ -41,10 +42,9 @@
41
42
  },
42
43
  "scripts": {
43
44
  "build": "tsup",
44
- "dev": "concurrently \"pnpm run dev:tsup\" \"pnpm run dev:serve\"",
45
- "dev:tsup": "tsup --watch",
46
- "dev:serve": "serve ./dist",
47
45
  "check-types": "tsc --noEmit",
46
+ "deploy": "wrangler deploy",
47
+ "dev": "wrangler dev --port 8000",
48
48
  "lint:fix": "biome check --write --unsafe"
49
49
  }
50
50
  }
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function r(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,l;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,n){return t(e)||r(e,n)||l(e,n)||o()}function i(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function l(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function u(e){return i(e.data)=="object"&&e.data!==null&&"event"in e.data&&(e.data.event==="resize"||e.data.event==="center")}function d(e){var t;function n(t){t.source===e.contentWindow&&u(t)&&(t.data.event==="resize"&&(e.style.height="".concat(t.data.height,"px")),t.data.event==="center"&&e.scrollIntoView({block:"center",inline:"center"}))}window.addEventListener("message",n),(t=window.wco)===null||t===void 0?void 0:t.frames.set(e,function(){window.removeEventListener("message",n)})}function c(e){if(e.dataset.whopCheckoutMounted)return;var t=e.dataset.whopCheckoutPlanId;if(!t)return;var n;var r=(n=e.dataset.whopCheckoutOrigin)!==null&&n!==void 0?n:"https://whop.com/",o=new URL("/embedded/checkout/".concat(t,"/"),r),a=e.dataset.whopCheckoutTheme;a&&o.searchParams.set("theme",a);var i=e.dataset.whopCheckoutSession;i&&o.searchParams.set("session",i);var l=new URL(window.location.href).origin;o.searchParams.set("h",l);var u=document.createElement("iframe");u.src=o.toString(),u.style.width="100%",u.style.height="480px",u.style.border="none",u.style.overflow="hidden",u.sandbox.add("allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"),u.allow="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;",e.dataset.whopCheckoutMounted="true",e.appendChild(u),d(u)}if((typeof window==="undefined"?"undefined":i(window))<"u"&&window.wco&&!window.wco.listening){var s=new MutationObserver(function(e){var t=true,r=false,o=undefined;try{for(var i=e[Symbol.iterator](),l;!(t=(l=i.next()).done);t=true){var u=l.value;var d,s;var f=true,w=false,v=undefined;try{for(var y=u.addedNodes[Symbol.iterator](),h;!(f=(h=y.next()).done);f=true){var m=h.value;n(m,HTMLElement)&&m.dataset.whopCheckoutPlanId&&c(m)}}catch(e){w=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(w){throw v}}}var p=Array.from(u.removedNodes);var b;var g=true,S=false,k=undefined;try{for(var x=((b=(d=window.wco)===null||d===void 0?void 0:d.frames)!==null&&b!==void 0?b:[])[Symbol.iterator](),C;!(g=(C=x.next()).done);g=true){var A=a(C.value,2),I=A[0],L=A[1];p.includes(I)&&(L(),(s=window.wco)===null||s===void 0?void 0:s.frames.delete(I))}}catch(e){S=true;k=e}finally{try{if(!g&&x.return!=null){x.return()}}finally{if(S){throw k}}}}}catch(e){r=true;o=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(r){throw o}}}});var f=true,w=false,v=undefined;try{for(var y=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),h;!(f=(h=y.next()).done);f=true){var m=h.value;n(m,HTMLElement)&&c(m)}}catch(e){w=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(w){throw v}}}s.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}
package/dist/index.d.mts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }
package/dist/index.html DELETED
@@ -1,20 +0,0 @@
1
- <!DOCTYPE html>
2
- <html style="height: 100%">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width">
6
- <script src="https://cdn.jsdelivr.net/npm/@whop/checkout/dist/loader.js"></script>
7
- <title>Whop embedded checkout</title>
8
- <style>
9
- div {
10
- box-sizing: border-box;
11
- }
12
- body {
13
- margin: 0
14
- }
15
- </style>
16
- </head>
17
- <body style="display: flex; height: fit-content; width: 100%">
18
- <div style="flex: 1; height: fit-content; overflow: hidden; max-width: 50%;" data-whop-checkout-theme="light" data-whop-checkout-plan-id="plan_QnbKDNAbfcXr8"></div>
19
- </body>
20
- </html>
package/dist/index.mjs DELETED
@@ -1 +0,0 @@
1
- function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function r(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,l;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,n){return t(e)||r(e,n)||l(e,n)||o()}function i(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function l(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function u(e){return i(e.data)=="object"&&e.data!==null&&"event"in e.data&&(e.data.event==="resize"||e.data.event==="center")}function d(e){var t;function n(t){t.source===e.contentWindow&&u(t)&&(t.data.event==="resize"&&(e.style.height="".concat(t.data.height,"px")),t.data.event==="center"&&e.scrollIntoView({block:"center",inline:"center"}))}window.addEventListener("message",n),(t=window.wco)===null||t===void 0?void 0:t.frames.set(e,function(){window.removeEventListener("message",n)})}function c(e){if(e.dataset.whopCheckoutMounted)return;var t=e.dataset.whopCheckoutPlanId;if(!t)return;var n;var r=(n=e.dataset.whopCheckoutOrigin)!==null&&n!==void 0?n:"https://whop.com/",o=new URL("/embedded/checkout/".concat(t,"/"),r),a=e.dataset.whopCheckoutTheme;a&&o.searchParams.set("theme",a);var i=e.dataset.whopCheckoutSession;i&&o.searchParams.set("session",i);var l=new URL(window.location.href).origin;o.searchParams.set("h",l);var u=document.createElement("iframe");u.src=o.toString(),u.style.width="100%",u.style.height="480px",u.style.border="none",u.style.overflow="hidden",u.sandbox.add("allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-downloads"),u.allow="document-domain; execution-while-not-rendered; execution-while-out-of-viewport; payment; paymentRequest; sync-script;",e.dataset.whopCheckoutMounted="true",e.appendChild(u),d(u)}if((typeof window==="undefined"?"undefined":i(window))<"u"&&window.wco&&!window.wco.listening){var s=new MutationObserver(function(e){var t=true,r=false,o=undefined;try{for(var i=e[Symbol.iterator](),l;!(t=(l=i.next()).done);t=true){var u=l.value;var d,s;var f=true,w=false,v=undefined;try{for(var y=u.addedNodes[Symbol.iterator](),h;!(f=(h=y.next()).done);f=true){var m=h.value;n(m,HTMLElement)&&m.dataset.whopCheckoutPlanId&&c(m)}}catch(e){w=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(w){throw v}}}var p=Array.from(u.removedNodes);var b;var g=true,S=false,k=undefined;try{for(var x=((b=(d=window.wco)===null||d===void 0?void 0:d.frames)!==null&&b!==void 0?b:[])[Symbol.iterator](),C;!(g=(C=x.next()).done);g=true){var A=a(C.value,2),I=A[0],L=A[1];p.includes(I)&&(L(),(s=window.wco)===null||s===void 0?void 0:s.frames.delete(I))}}catch(e){S=true;k=e}finally{try{if(!g&&x.return!=null){x.return()}}finally{if(S){throw k}}}}}catch(e){r=true;o=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(r){throw o}}}});var f=true,w=false,v=undefined;try{for(var y=document.querySelectorAll("[data-whop-checkout-plan-id]")[Symbol.iterator](),h;!(f=(h=y.next()).done);f=true){var m=h.value;n(m,HTMLElement)&&c(m)}}catch(e){w=true;v=e}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(w){throw v}}}s.observe(document.body,{childList:!0,subtree:!0}),window.wco.listening=!0}
package/dist/loader.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var n=document.currentScript,o=n===null||n===void 0?void 0:n.src;var d;(typeof window==="undefined"?"undefined":e(window))<"u"&&o&&((d=window.wco)!==null&&d!==void 0?d:window.wco=function(){var e=document.createElement("script");return e.src=o.replace(/loader\.js$/,"index.js"),e.async=!0,e.defer=!0,document.head.appendChild(e),{injected:!0,listening:!1,frames:new Map}}());
package/dist/loader.d.mts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }
package/dist/loader.mjs DELETED
@@ -1 +0,0 @@
1
- function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var n=document.currentScript,o=n===null||n===void 0?void 0:n.src;var d;(typeof window==="undefined"?"undefined":e(window))<"u"&&o&&((d=window.wco)!==null&&d!==void 0?d:window.wco=function(){var e=document.createElement("script");return e.src=o.replace(/loader\.js$/,"index.js"),e.async=!0,e.defer=!0,document.head.appendChild(e),{injected:!0,listening:!1,frames:new Map}}());
File without changes
File without changes
File without changes