{"_id":"@mesub/react","_rev":"8-93276b879ab44696f28a675b80d2e5ce","name":"@mesub/react","dist-tags":{"latest":"0.1.5"},"versions":{"0.0.0-stage":{"name":"@mesub/react","version":"0.0.0-stage","_id":"@mesub/react@0.0.0-stage","stub":true,"maintainers":[{"name":"ft_gring0","email":"emiledubdart@gmail.com"}],"dist":{"shasum":"5ce791267a80d4ef1bdd4c0464e934e56fd846b9","tarball":"https://registry.npmjs.org/@mesub/react/-/react-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-u82IRuoShs8c9LwEz02UyZwgAYAJ282lQWneJEfEQ4ijuT2w5pgXMVmdAJ1eT/bnrlYLCDcxDFBtpZvj1faCYw==","signatures":[{"sig":"MEYCIQDsAzoW3MqcmEPsibh3h2hsMxjf5xU3y0g9bATviM02YQIhAKr1uOycuA4BgI8AdDVLr10/PEBKLbZuF786o9RC87QD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":334},"_npmUser":{"name":"ft_gring0","email":"emiledubdart@gmail.com"},"deprecated":"Placeholder, install @mesub/react@latest","description":"Temporary package placeholder for staged publishing","directories":{}},"0.1.0":{"name":"@mesub/react","version":"0.1.0","keywords":["mesub","solana","subscriptions","react","sdk","widget","wallet","usdc"],"license":"MIT","_id":"@mesub/react@0.1.0","maintainers":[{"name":"ft_gring0","email":"emiledubdart@gmail.com"}],"homepage":"https://github.com/Mesub-io/react-sdk#readme","bugs":{"url":"https://github.com/Mesub-io/react-sdk/issues"},"dist":{"shasum":"9f1145a7e8d7dc9109ea3f5dfb5d7d6b147392a8","tarball":"https://registry.npmjs.org/@mesub/react/-/react-0.1.0.tgz","fileCount":10,"integrity":"sha512-2PEWNJyu55coz0DXkobhKbwEYNw04cOERSD3zt5lOf31HdjgOB+SVTgL5fhAHPltM43GmrX83XFl/1y+Qx3/lQ==","signatures":[{"sig":"MEUCIQCAP2QYkmO8usPkOLWeHwEGZIDUdvaJGZl24cHPOfzBMAIgJUKWqWGFQFFUGFmM3oE0trmnnY90g5Vwc5FsnGdALTk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDc6ZKl2Ow95LMEsnZF5IiMhj6E0KmHiVWg12/tYX9RzAIhAIzuXUJ7YumroYQydiH9/Dlogkx92ewybniyMliSl/84","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mesub%2freact@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":864399},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./styles.css":"./styles.css","./package.json":"./package.json"},"gitHead":"d325afef87541849a9fc59b66f78900eb89a06da","scripts":{"lint":"oxlint --deny-warnings src/ test/","test":"vitest run","build":"tsup","format":"prettier --write .","prepare":"husky || true","typecheck":"tsc --noEmit","playground":"vite --config playground/vite.config.ts","test:watch":"vitest","format:check":"prettier --check .","check:exports":"node scripts/check-exports.mjs","prepublishOnly":"pnpm build && pnpm check:exports","playground:server":"node --env-file=playground/.env.local playground/server.mjs"},"_npmUser":{"name":"ft_gring0","email":"emiledubdart@gmail.com"},"repository":{"url":"git+https://github.com/Mesub-io/react-sdk.git","type":"git"},"_npmVersion":"11.19.0","description":"React widget for Mesub: the wallet part of subscribing, cancelling, resuming and closing, on top of the routes @mesub/node mounts on your server.","directories":{},"lint-staged":{"*.{ts,tsx,mjs}":["oxlint --deny-warnings","prettier --check"],"*.{json,md,yml,yaml}":["prettier --check"]},"sideEffects":["*.css"],"_nodeVersion":"24.21.0","dependencies":{"@solana/kit":"^8.4.0","@wallet-standard/react":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.27.0","devDependencies":{"tsup":"^8.5.1","vite":"^7.3.6","husky":"^9.1.7","react":"^19.3.0","oxlint":"^1.86.0","vitest":"^4.1.11","prettier":"^3.9.9","happy-dom":"^20.14.5","react-dom":"^19.3.0","typescript":"^6.0.3","@types/node":"^24.19.0","lint-staged":"^17.6.0","@types/react":"^19.3.0","@types/react-dom":"^19.3.0","@testing-library/dom":"^10.4.2","@vitejs/plugin-react":"^5.2.0","@testing-library/react":"^16.3.3"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/react_0.1.0_1792164835828_0.6982674387763688","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@mesub/react","version":"0.1.2","keywords":["mesub","solana","subscriptions","react","sdk","widget","wallet","usdc"],"license":"MIT","_id":"@mesub/react@0.1.2","maintainers":[{"name":"faiz777","email":"faizwinters777@gmail.com"},{"name":"ft_gring0","email":"emiledubdart@gmail.com"}],"homepage":"https://github.com/Mesub-io/react-sdk#readme","bugs":{"url":"https://github.com/Mesub-io/react-sdk/issues"},"dist":{"shasum":"9370907c43cc14df60c4f39c6e95606591dca4c7","tarball":"https://registry.npmjs.org/@mesub/react/-/react-0.1.2.tgz","fileCount":10,"integrity":"sha512-Wrj24oh0hXqhOw92Q33s/FokwYKs7eW8rZ3OrL15URaeO5UZthQpGp8M1vb2cEEBihQ1hD/t9GABTLkp80OnlA==","signatures":[{"sig":"MEYCIQCEA4Vwp+nHjJE6hYndIf6+k8YnLauPcDQdkHliHSelUwIhAOTlXKUeTqqmWuAIN/s2Nd1Ow9Wryf13+Y7EY8XztfSq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mesub%2freact@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":868527},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./styles.css":"./styles.css","./package.json":"./package.json"},"gitHead":"e2b24cf7eb8c8ae8fb159be668e1bfd4809b3c7d","scripts":{"lint":"oxlint --deny-warnings src/ test/","test":"vitest run","build":"tsup","format":"prettier --write .","prepare":"husky || true","typecheck":"tsc --noEmit","playground":"vite --config playground/vite.config.ts","test:watch":"vitest","format:check":"prettier --check .","check:exports":"node scripts/check-exports.mjs","prepublishOnly":"pnpm build && pnpm check:exports","playground:server":"node --env-file=playground/.env.local playground/server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","approver":{"name":"faiz777","email":"faizwinters777@gmail.com"},"trustedPublisher":{"id":"github","oidcConfigId":"3d2bfe12-4f64-4367-a209-f6bad27b08ec"}},"repository":{"url":"git+https://github.com/Mesub-io/react-sdk.git","type":"git"},"_npmVersion":"11.19.0","description":"React widget for Mesub: the wallet part of subscribing, cancelling, resuming and closing, on top of the routes @mesub/node mounts on your server.","directories":{},"lint-staged":{"*.{ts,tsx,mjs}":["oxlint --deny-warnings","prettier --check"],"*.{json,md,yml,yaml}":["prettier --check"]},"sideEffects":["*.css"],"_nodeVersion":"24.21.0","dependencies":{"@solana/kit":"^8.4.0","@wallet-standard/react":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.27.0","devDependencies":{"tsup":"^8.5.1","vite":"^7.3.6","husky":"^9.1.7","react":"^19.3.0","oxlint":"^1.86.0","vitest":"^4.1.11","prettier":"^3.9.9","happy-dom":"^20.14.5","react-dom":"^19.3.0","typescript":"^6.0.3","@types/node":"^24.19.0","lint-staged":"^17.6.0","@types/react":"^19.3.0","@types/react-dom":"^19.3.0","@testing-library/dom":"^10.4.2","@vitejs/plugin-react":"^5.2.0","@testing-library/react":"^16.3.3"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/react_0.1.2_1792539062816_0.9197193028775288","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@mesub/react","version":"0.1.3","keywords":["mesub","solana","subscriptions","react","sdk","widget","wallet","usdc"],"license":"MIT","_id":"@mesub/react@0.1.3","maintainers":[{"name":"faiz777","email":"faizwinters777@gmail.com"},{"name":"ft_gring0","email":"emiledubdart@gmail.com"}],"homepage":"https://github.com/Mesub-io/react-sdk#readme","bugs":{"url":"https://github.com/Mesub-io/react-sdk/issues"},"dist":{"shasum":"53172fcc7c5b326737430d1b36838cf21ac210e8","tarball":"https://registry.npmjs.org/@mesub/react/-/react-0.1.3.tgz","fileCount":10,"integrity":"sha512-kJCAcsiRbWqQGDhsAC0VdD5BFy8pKYHcRfrbukArGPlqq5fVxkjNjyFm/tuz+FklHd27VsUdjWREEVljJYBYAg==","signatures":[{"sig":"MEUCIQCJd7TXN1C0pdzyfx9DU4psv9NY7gjdyWtg4l3Gdm/xOQIgFDfU9edxTcT4md9H2GpQwKf525gaid3wR4HuFibF0Us=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mesub%2freact@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":878027},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./styles.css":"./styles.css","./package.json":"./package.json"},"gitHead":"ae2731af809f339fb5b178dfddcb727dfe388710","scripts":{"lint":"oxlint --deny-warnings src/ test/","test":"vitest run","build":"tsup","format":"prettier --write .","prepare":"husky || true","typecheck":"tsc --noEmit","playground":"vite --config playground/vite.config.ts","test:watch":"vitest","format:check":"prettier --check .","check:exports":"node scripts/check-exports.mjs","prepublishOnly":"pnpm build && pnpm check:exports","playground:server":"node --env-file=playground/.env.local playground/server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","approver":{"name":"ft_gring0","email":"emiledubdart@gmail.com"},"trustedPublisher":{"id":"github","oidcConfigId":"3d2bfe12-4f64-4367-a209-f6bad27b08ec"}},"repository":{"url":"git+https://github.com/Mesub-io/react-sdk.git","type":"git"},"_npmVersion":"11.19.1","description":"React widget for Mesub: the wallet part of subscribing, cancelling, resuming and closing, on top of the routes @mesub/node mounts on your server.","directories":{},"lint-staged":{"*.{ts,tsx,mjs}":["oxlint --deny-warnings","prettier --check"],"*.{json,md,yml,yaml}":["prettier --check"]},"sideEffects":["*.css"],"_nodeVersion":"24.22.2","dependencies":{"@solana/kit":"^8.4.0","@wallet-standard/react":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.27.0","devDependencies":{"tsup":"^8.5.1","vite":"^7.3.6","husky":"^9.1.7","react":"^19.3.0","oxlint":"^1.86.0","vitest":"^4.1.11","prettier":"^3.9.9","happy-dom":"^20.14.5","react-dom":"^19.3.0","typescript":"^6.0.3","@types/node":"^24.19.0","lint-staged":"^17.6.0","@types/react":"^19.3.0","@types/react-dom":"^19.3.0","@testing-library/dom":"^10.4.2","@vitejs/plugin-react":"^5.2.0","@testing-library/react":"^16.3.3"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/react_0.1.3_1794237641462_0.6882650475540791","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@mesub/react","version":"0.1.4","keywords":["mesub","solana","subscriptions","react","sdk","widget","wallet","usdc"],"license":"MIT","_id":"@mesub/react@0.1.4","maintainers":[{"name":"faiz777","email":"faizwinters777@gmail.com"},{"name":"ft_gring0","email":"emiledubdart@gmail.com"}],"homepage":"https://github.com/Mesub-io/react-sdk#readme","bugs":{"url":"https://github.com/Mesub-io/react-sdk/issues"},"dist":{"shasum":"73626800b6d6b34186be3050c848344d791b69f4","tarball":"https://registry.npmjs.org/@mesub/react/-/react-0.1.4.tgz","fileCount":10,"integrity":"sha512-ggwKA6We6qSBfUe4/jJXY3OH27xxD9AYYRzGlEEmnfy+dmgzl9MSPlE4vk8VPAL14COXDERNqetFk2aDtIyiNg==","signatures":[{"sig":"MEYCIQDVxAWcHFYOI2bhXnLeUYFoL58ttoIkIBa9LMp42tYYygIhALmiJMA0ARHLpEVv95Fg9blWuQhT+RmfoSZdWQn6Amw0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mesub%2freact@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":902888},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./styles.css":"./styles.css","./package.json":"./package.json"},"gitHead":"d56f638c1ef5cbbd1e0c2fe1a27c5e90190f704b","scripts":{"lint":"oxlint --deny-warnings src/ test/","test":"vitest run","build":"tsup","format":"prettier --write .","prepare":"husky || true","typecheck":"tsc --noEmit","playground":"vite --config playground/vite.config.ts","test:watch":"vitest","format:check":"prettier --check .","check:exports":"node scripts/check-exports.mjs","prepublishOnly":"pnpm build && pnpm check:exports","playground:server":"node --env-file=playground/.env.local playground/server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","approver":{"name":"ft_gring0","email":"emiledubdart@gmail.com"},"trustedPublisher":{"id":"github","oidcConfigId":"3d2bfe12-4f64-4367-a209-f6bad27b08ec"}},"repository":{"url":"git+https://github.com/Mesub-io/react-sdk.git","type":"git"},"_npmVersion":"11.19.1","description":"React widget for Mesub: the wallet part of subscribing, cancelling, resuming and closing, on top of the routes @mesub/node mounts on your server.","directories":{},"lint-staged":{"*.{ts,tsx,mjs}":["oxlint --deny-warnings","prettier --check"],"*.{json,md,yml,yaml}":["prettier --check"]},"sideEffects":["*.css"],"_nodeVersion":"24.22.2","dependencies":{"@solana/kit":"^8.4.0","@wallet-standard/react":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.27.0","devDependencies":{"tsup":"^8.5.1","vite":"^7.3.6","husky":"^9.1.7","react":"^19.3.0","oxlint":"^1.86.0","vitest":"^4.1.11","prettier":"^3.9.9","happy-dom":"^20.14.5","react-dom":"^19.3.0","typescript":"^6.0.3","@types/node":"^24.19.0","lint-staged":"^17.6.0","@types/react":"^19.3.0","@types/react-dom":"^19.3.0","@testing-library/dom":"^10.4.2","@vitejs/plugin-react":"^5.2.0","@testing-library/react":"^16.3.3"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/react_0.1.4_1794407503924_0.3008375302651036","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"_id":"@mesub/react@0.1.5","bugs":{"url":"https://github.com/Mesub-io/react-sdk/issues"},"dist":{"shasum":"d43d0c6f595f2029eb5a15b4e370ad982405babf","tarball":"https://registry.npmjs.org/@mesub/react/-/react-0.1.5.tgz","integrity":"sha512-scuNLJx6kHRd1FiGCFgCxck6cIst83dujQe/z49UuiSeoxJhIrcqzZa1zZWTaMVE2Uk1PnSp/+41h8lJeCrtYw==","fileCount":10,"unpackedSize":946572,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mesub%2freact@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGmbbFwvpHtjWWbN1LwQ7S9bSQ3uDfwTWahu4wn4MFiLAiEAwMgzcXyrxZVbkdxnzGVfGYXJNe2kMKB6hXIGS1aQaYQ="}]},"main":"./dist/index.cjs","name":"@mesub/react","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./styles.css":"./styles.css","./package.json":"./package.json"},"gitHead":"23e531e01abece28b797f227d3272af5fe3ac95d","license":"MIT","scripts":{"lint":"oxlint --deny-warnings src/ test/","test":"vitest run","build":"tsup","format":"prettier --write .","prepare":"husky || true","typecheck":"tsc --noEmit","playground":"vite --config playground/vite.config.ts","test:watch":"vitest","format:check":"prettier --check .","check:exports":"node scripts/check-exports.mjs","prepublishOnly":"pnpm build && pnpm check:exports","playground:server":"node --env-file=playground/.env.local playground/server.mjs"},"version":"0.1.5","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"3d2bfe12-4f64-4367-a209-f6bad27b08ec"},"approver":{"name":"ft_gring0","email":"emiledubdart@gmail.com"}},"homepage":"https://github.com/Mesub-io/react-sdk#readme","keywords":["mesub","solana","subscriptions","react","sdk","widget","wallet","usdc"],"repository":{"url":"git+https://github.com/Mesub-io/react-sdk.git","type":"git"},"_npmVersion":"11.19.1","description":"React widget for Mesub: the wallet part of subscribing, cancelling, resuming and closing, on top of the routes @mesub/node mounts on your server.","directories":{},"lint-staged":{"*.{ts,tsx,mjs}":["oxlint --deny-warnings","prettier --check"],"*.{json,md,yml,yaml}":["prettier --check"]},"maintainers":[{"name":"faiz777","email":"faizwinters777@gmail.com"},{"name":"ft_gring0","email":"emiledubdart@gmail.com"}],"sideEffects":["*.css"],"_nodeVersion":"24.22.2","dependencies":{"@solana/kit":"^8.4.0","@wallet-standard/react":"^1.0.3"},"publishConfig":{"access":"public"},"packageManager":"pnpm@11.27.0","devDependencies":{"tsup":"^8.5.1","vite":"^7.3.6","husky":"^9.1.7","react":"^19.3.0","oxlint":"^1.86.0","vitest":"^4.1.11","prettier":"^3.9.9","happy-dom":"^20.14.5","react-dom":"^19.3.0","typescript":"^6.0.3","@types/node":"^24.19.0","lint-staged":"^17.6.0","@types/react":"^19.3.0","@types/react-dom":"^19.3.0","@testing-library/dom":"^10.4.2","@vitejs/plugin-react":"^5.2.0","@testing-library/react":"^16.3.3"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react_0.1.5_1794411950768_0.9160361907815655"},"_hasShrinkwrap":false}},"time":{"created":"2026-10-16T15:32:58.636Z","modified":"2026-11-11T15:45:51.518Z","0.0.0-stage":"2026-10-16T15:32:58.636Z","0.1.0":"2026-10-16T15:33:55.920Z","0.1.2":"2026-10-20T23:31:02.923Z","0.1.3":"2026-11-09T15:20:41.607Z","0.1.4":"2026-11-11T14:31:44.018Z","0.1.5":"2026-11-11T15:45:50.876Z"},"bugs":{"url":"https://github.com/Mesub-io/react-sdk/issues"},"license":"MIT","homepage":"https://github.com/Mesub-io/react-sdk#readme","keywords":["mesub","solana","subscriptions","react","sdk","widget","wallet","usdc"],"repository":{"url":"git+https://github.com/Mesub-io/react-sdk.git","type":"git"},"description":"React widget for Mesub: the wallet part of subscribing, cancelling, resuming and closing, on top of the routes @mesub/node mounts on your server.","maintainers":[{"name":"faiz777","email":"faizwinters777@gmail.com"},{"name":"ft_gring0","email":"emiledubdart@gmail.com"}],"readme":"# @mesub/react\n\nThe browser side of [Mesub](https://mesub.io), recurring payments on Solana: a\nSubscribe button and a list of subscriptions that handle the wallet for you.\n\nIt is a complement to [`@mesub/node`](https://github.com/Mesub-io/node-sdk),\nwhich does everything on its own. This package only spares you the wallet\npart in the browser: picking one, connecting it, signing in the right order.\n\n- It **never talks to Mesub** and holds **no key**. It calls your own server,\n  on the routes `@mesub/node` mounts there.\n- Your customer has **no Mesub account**. Who they are comes from your own\n  login: there is no sign-in here, no session, no token.\n- It is **not a wallet connector** for your site. It asks a wallet for an\n  account when it needs a signature, and never disconnects one.\n\n**[Read the docs](https://docs.mesub.io/docs/react)** for the walkthrough.\n\n[![npm](https://img.shields.io/npm/v/@mesub/react)](https://www.npmjs.com/package/@mesub/react)\n\n> **Status: early, 0.x.** The API may still change between minor versions:\n> `npm update` takes patches (0.1.x), a new minor (0.2.0) takes\n> `npm install @mesub/react@latest`. See the\n> [board](https://github.com/orgs/Mesub-io/projects/5) for what is next.\n\n## Install\n\n```sh\nnpm install @mesub/react\n```\n\n`react` and `react-dom` 18 or later are peer dependencies. Every release is\nbuilt by GitHub Actions from a tagged commit and published with a provenance\nstatement: `npm audit signatures` verifies it.\n\n## Requirements\n\nReact 18 or 19. Works with Next.js's App Router: the build starts with\n`'use client'`. Nothing Solana to install on your side.\n\nOn your server, `@mesub/node` with its routes mounted (`mesubRoutes` or\n`mesubRouteHandlers`): `@mesub/react` 0.1.x works with the routes of\n`@mesub/node` 0.1.x. Upgrade both to the same minor together.\n\n## One line on each side\n\nOn your server, after your own login\n([details](https://github.com/Mesub-io/node-sdk#routes-for-the-react-widget)):\n\n```ts\nimport { mesubRoutes } from '@mesub/node/express';\n\napp.use(\n    '/api/mesub',\n    mesubRoutes({ customer: (req) => (req.user ? { external_id: req.user.id } : null) }),\n);\n```\n\nIn your app, once:\n\n```tsx\nimport { MesubProvider } from '@mesub/react';\nimport '@mesub/react/styles.css';\n\nexport function App({ children }) {\n    return <MesubProvider endpoint=\"/api/mesub\">{children}</MesubProvider>;\n}\n```\n\n| Prop              | What it is                                                                                                                                                  |\n| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `endpoint`        | Where you mounted the routes. A path on your site, or a full URL.                                                                                           |\n| `chain`           | The network the wallet signs for: `solana:mainnet` (the default, where Mesub runs). It must match your plans' `network`.                                    |\n| `fetch`           | Your own `(url, init) => Promise<Response>`, to add headers or credentials.                                                                                 |\n| `theme`           | `light`, `dark` or `auto`, set on the widget as `data-mesub-theme`.                                                                                         |\n| `manageUrl`       | Where \"Cancel any time\" leads once subscribed: your own page (`/account`, or a full URL). Mesub's page by default; `null` for no button.                    |\n| `openInWalletUrl` | On a phone with no wallet in the browser, the page Phantom or Solflare reopens in its own browser (`/pricing`, or a full URL). The current page by default. |\n\nRequests go with `credentials: 'include'`, so your session cookie travels. If\nyour login is a bearer token instead, add it in `fetch`:\n\n```tsx\n<MesubProvider\n    endpoint=\"/api/mesub\"\n    fetch={(url, init) =>\n        fetch(url, { ...init, headers: { ...init.headers, Authorization: `Bearer ${token}` } })\n    }\n>\n```\n\n## Subscribe\n\n```tsx\nimport { SubscribeButton } from '@mesub/react';\n\n<SubscribeButton plan=\"pro\" onSubscribed={(subscription) => unlock(subscription)}>\n    Subscribe to Pro\n</SubscribeButton>;\n```\n\n`plan` is the plan's slug, as set in the Mesub dashboard. The click opens one\ndialog, from the plan to the receipt:\n\n1. **The plan**: its name, price and period, from `GET /plans/:slug`, and its end\n   when it has one. A plan ends on any second, so its end is always written\n   with its time, in UTC, the same for every subscriber: `Oct 20, 2026, 23:59 UTC`.\n   A plan that ends before a second charge can run is priced `once`, with the\n   end its access runs to.\n2. **A wallet**: the installed wallets that can sign\n   ([Wallet Standard](https://github.com/wallet-standard/wallet-standard), so\n   Phantom, Solflare and the others). The one picked is asked for its account.\n3. **The review**: your server prepares the subscription\n   (`POST /subscriptions`), and the dialog shows what it costs before the wallet\n   is asked anything: the price, the next charge, the paying wallet, the deposit\n   returned when the subscription is closed, the network fee, and the terms.\n   From here to the receipt, the terms decide whether it is a single charge\n   (`Amount: 2 USDC, a single charge`): no next charge is shown then, only the\n   end of the access.\n4. **Two approvals**: the wallet signs the terms, a message\n   (`solana:signMessage`), then the transaction, without sending it\n   (`solana:signTransaction`). A transaction lives about half a minute, so a\n   fresh one is asked for once the terms are signed\n   (`POST /subscriptions/:id/transaction`), and that one is signed. If it names\n   new terms, they are shown and signed again. A server whose `@mesub/node`\n   predates the route answers 404: the transaction of the review is signed.\n5. **Confirming**: both go to `POST /subscriptions/:id/submit`. Mesub co-signs\n   and sends the transaction, and `onSubscribed` fires once it landed.\n   A transaction that expired before it was sent (`transaction_expired`, as an\n   error code or as the submit's `reason_code`) is replaced once, for the same\n   subscription, and signed again; a second expiry in a row stops with \"Nothing\n   was charged.\" One the wallet held past its `transaction_expires_at` is\n   replaced the same way before it is submitted, the time left counted on your\n   server's clock (its `Date` header) when the browser can read it.\n\nThe button is a `<button>` with `data-mesub-subscribe` and `data-mesub-state`\n(`idle`, `open`, `signing`, `confirming` or `subscribed`). `children` is its\nlabel, every other button prop goes to the button, and an `onClick` that calls\n`preventDefault()` stops the flow. Once subscribed it is followed by\n`<span data-mesub-receipt>`.\n\nFor a button of your own, `useSubscribe` opens the same dialog:\n\n```tsx\nimport { useSubscribe } from '@mesub/react';\n\nfunction Buy() {\n    const { state, subscribe } = useSubscribe('pro', { onSubscribed: unlock });\n    return (\n        <button disabled={state !== 'idle'} onClick={() => void subscribe()}>\n            {state === 'subscribed' ? 'Thanks!' : 'Buy'}\n        </button>\n    );\n}\n```\n\n`subscribe()` resolves when the dialog closes: with the subscription, or null\nwhen it did not go through. The hook also gives `subscription` and\n`signature`, the transaction's id when the wallet is its first signer.\n\n## Manage\n\n```tsx\nimport { ManageButton } from '@mesub/react';\n\n<ManageButton plan=\"pro\" />;\n```\n\nA button, like `SubscribeButton`: it opens the customer's subscription to that\nplan in the Mesub window. One subscription, not a list: how it stands, what is\ncharged next, the latest payments with their receipts, and the one thing it\nallows now (cancel, resume or close). Leave `plan` out to open the customer's\nlive subscription whatever its plan. Pass children to word the button your way.\n\nThe payments and the next charge come from `GET /subscriptions/:id` of the\nroutes; on a server that predates it, the window stands without them.\n\nTo list every subscription in a page of yours instead:\n\n```tsx\nimport { ManageSubscriptions } from '@mesub/react';\n\n<ManageSubscriptions onChanged={(subscription) => refresh(subscription)} />;\n```\n\nThe signed-in customer's subscriptions, from `GET /subscriptions`: each with\nits plan, its status, its next charge or the end of its access, the wallet that\npays it, and the one thing it allows now. A subscription in the last period of\na plan that ends has no next charge: it shows the end of its access instead.\n\n| The subscription is                                                    | It allows  |\n| ---------------------------------------------------------------------- | ---------- |\n| running (`active`, `unpaid`, `stopped`)                                | **Cancel** |\n| `cancelled`, with access still running                                 | **Resume** |\n| `closable: true` (ended, cancelled and past its end, stopped for good) | **Close**  |\n\nClose follows `closable`, as Mesub last read the chain. Until then, a card\nshows **Close from** and the date of `closable_from`, and offers Close once\nthat date passes with the page open. A cancellation with a payment missed has\nno access and cannot be resumed: it offers nothing until it can be closed. A\nserver that predates `closable` is read by the status and the dates, as before.\nA `stopped` one says why from `stop_reason`: every retry failed, the date to pay\nby passed, or the wallet's approval was closed for good (that one is closed, not\ncancelled).\n\nEach opens a dialog that says what it does, then runs two steps: your server\nbuilds a transaction (`POST /subscriptions/:id/cancel`, `/resume` or `/close`),\nthe wallet **signs and sends it itself** (`solana:signAndSendTransaction`), and\nits signature goes to the matching `/confirm`. The list is read again after.\n\nA late one (`unpaid`) also shows **Pay now** when paying can succeed: the\ncustomer pays the missed period at once, with nothing to sign, through\n`POST /subscriptions/:id/retry` of the routes (`subscriptions.retry` of\n`@mesub/node`). Not on a paused one, on a wallet that no longer approves it,\nnor past its date to pay by. What came of it is said under the button: the\npayment on its way, or why not (a short wallet spends no retry). On Free,\nwhere Mesub does not try again on its own, the card shows that date to pay by.\n\nWhen the server could not read a subscription's past payments, its window\nsays so in one line rather than show none.\n\nOne whose charges are held back for a cause that is not the customer's\n(`blocked_since`) says so in one line: payments are on hold, nothing is asked\nof them, and until when their access runs. The cause is never named to them,\nand **Pay now** is not offered meanwhile.\n\nOnly the wallet that pays a subscription can sign for it. One already\nconnected to your site is found without a prompt; otherwise the customer picks\nit. Closing returns the deposit to that wallet.\n\nFor a list of your own, `useSubscriptions` gives the same:\n\n```tsx\nimport { useSubscriptions } from '@mesub/react';\n\nfunction Mine() {\n    const { state, subscriptions, error, reload, manage } = useSubscriptions();\n\n    if (state === 'signed-out') return <a href=\"/login\">Sign in</a>;\n    return subscriptions.map((held) => (\n        <button key={held.id} disabled={!held.action} onClick={() => void manage(held.id)}>\n            {held.plan}: {held.status}, {held.action ?? 'nothing to do'}\n        </button>\n    ));\n}\n```\n\n- `state` is `loading`, `ready`, `signed-out` or `error` (with `error`, the\n  server's message).\n- `subscriptions` are newest first, each with `action`: `cancel`, `resume`,\n  `close` or null, and `payable`: whether **Pay now** can succeed. Checkouts\n  nobody signed are left out.\n- `hasMore` is true when the customer holds more than the server listed (its\n  500 newest): older ones are missing. `ManageSubscriptions` says so under its\n  list.\n- `payNow(id)` pays that late payment now and resolves `{ ok, message }`, the\n  words to show; it never throws.\n- `manage(id)` opens the dialog for that action and resolves when it closes:\n  the subscription as it is now, or null if nothing changed.\n- Every list reads again when a subscription is made or changed through the\n  widget; `reload()` does it on demand.\n\nFields are as `@mesub/node` serves them: snake case, dates as ISO strings.\n\n## The states to know\n\nEach one has its own screen, and says whether anything moved: \"Nothing was\ncharged.\" (or \"Nothing changed.\") only when nothing can have landed.\n\n- **Nobody signed in on your site** (your routes answer 401): the dialog says\n  to sign in first and offers nothing to sign; the list says to sign in.\n- **No wallet installed**: links to Phantom and Solflare, and Reload.\n- **A wallet that cannot sign a message, or a transaction without sending\n  it**: left out of the list, and named with what it lacks.\n- **The wallet refuses** to connect, to sign the terms or to sign the\n  transaction: nothing is submitted. Try again asks your server anew and shows\n  the review again.\n- **The terms expired** (`expires_at` passed, before or between the two\n  signatures): your server is asked again and the review comes back with fresh\n  terms. Stale terms are never signed nor submitted.\n- **The wrong wallet** for a subscription being managed: it says which account\n  the wallet is on and which one pays. Nothing is built or signed.\n- **Nothing settled** (`reason` on submit or on a confirm): the widget branches\n  on `reason_code`, never on the sentence. `transaction_expired` asks for a\n  fresh transaction, as above, on submit, and builds a new one on a confirm.\n  `nothing_landed` on submit, or `cancellation_not_landed`,\n  `resume_not_landed` and `close_not_landed` on a confirm: the transaction may\n  still land, so it says so and offers Check again, which sends nothing new.\n  Any other code: Mesub's reason, as written, and Try again.\n- **Mesub refuses** (409: already subscribed, not enough to pay the first\n  period, plan closed...): its message, as written. A 403 `wallet_mismatch`\n  asks for another wallet, a 429 says how long to wait.\n- **The network fails or times out**: 15 seconds on reads and builds, with Try\n  again. Submit and the confirms wait 90 seconds for the chain; past that, or\n  on a 5xx, the outcome is unknown: \"Payment may be pending\" and Check again,\n  which sends the same request and never a second payment.\n- **Mesub is busy** (a 503 `unavailable` with `Retry-After`): on submit, too\n  many at once and nothing was signed or sent, so the widget waits (2 seconds,\n  10 at most) and sends the same request once more; still busy, it says how\n  long to wait and offers Check again. **Pay now** refused that way holds its\n  button with a countdown (about 20 seconds), says nothing was charged, then\n  can be pressed again; preparing says when to try again.\n- **Double clicks** open one dialog, prepare one subscription and ask the\n  wallet once.\n\n## Theming\n\n`@mesub/react/styles.css` styles the widget only, through its `data-mesub-*`\nattributes (no class names), and reads your `--mesub-*` custom properties\nwithout ever setting them: set `--mesub-accent`, `--mesub-bg`, `--mesub-text`,\n`--mesub-font` or `--mesub-radius` on `:root` to brand it. Dark mode is\n`data-mesub-theme=\"dark\"` on the widget or an ancestor, `\"auto\"` follows the\nsystem, and `<MesubProvider theme=\"dark\">` sets it on the widget for you. Under\n480px the dialog is a bottom sheet, and motion follows\n`prefers-reduced-motion`. Leave the stylesheet out to style the attributes\nyourself.\n\nThe dialog is a native `<dialog>`; `data-mesub-step` says where it is: `plan`,\n`wallet`, `review`, `approve`, `confirming`, `subscribed` when subscribing, and\n`confirm`, `wallet`, `approve`, `confirming`, `done` when managing. The list is\n`[data-mesub-subscriptions]`, with `data-mesub-state`, one\n`[data-mesub-subscription]` per row, `[data-mesub-status]` and\n`[data-mesub-action]`.\n\n## Development\n\n```sh\npnpm install\npnpm test          # in happy-dom, with Testing Library\npnpm typecheck\npnpm lint\npnpm build         # dist/, ESM and CJS, with declaration files\npnpm check:exports # resolves through import and require, starts with 'use client'\n```\n\nThe pre-push hook runs all of it, as CI does. [`playground/`](./playground)\nruns the widget against a local back, with a merchant server that mounts the\nroutes.\n\n### Releasing\n\nA version tag on main publishes, once a reviewer approves: see\n[RELEASING.md](./RELEASING.md) for the one-time setup, the checklist and the\ncompatibility rule with `@mesub/node`, and [CHANGELOG.md](./CHANGELOG.md) for\nwhat changed.\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}