This repository contains the Stash Pay SDK package and a Next.js playground demonstrating its usage.
The Stash Pay SDK, published to npm. Ships three entry points from a single install:
- React component —
import { StashPay } from '@stashgg/stash-pay' - Framework-agnostic core —
import { open } from '@stashgg/stash-pay/vanilla' - Script-tag UMD —
<script src="proxy.php?url=https%3A%2F%2Funpkg.com%2F%40stashgg%2Fstash-pay%402%2Fdist%2Fumd%2Fstash-pay.umd.global.js">exposeswindow.StashPay.open({ … })(works inside Unity WebGL and any HTML page)
See packages/stash-pay/README.md for the full API reference, packages/stash-pay/MIGRATION.md for the v1→v2 upgrade path.
A Next.js 16 playground: paste a Stash Pay checkout URL, tweak the config, watch callbacks stream into the reaction log. Published at https://stash-pay-web.vercel.app/.
The sample also ships a no-React smoke page at /umd-test.html which loads the UMD bundle directly from <script>.
npm installnpm run devThis starts the Next.js playground at http://localhost:3000. The SDK is consumed from the monorepo workspace, so changes under packages/stash-pay/src/ are picked up after npm run build:package.
npm run build:package # only the SDK (tsup produces ESM + CJS + UMD + .d.ts + CSS)
npm run build:sample # Next.js build (prebuild hook rebuilds the package)
npm run build # bothnpm run dev— start the sample playgroundnpm run build— build all workspacesnpm run build:package— build only@stashgg/stash-paynpm run build:sample— build only the playground (rebuilds the SDK first)npm run typecheck --workspace=@stashgg/stash-pay— typecheck the SDK without emitting
The playground doesn't call the Stash Pay API directly — you paste a pre-generated checkout URL. See the Stash Pay integration guide for how to generate one from your server.