Skip to main content

Repository

github.com/stashgg/stash-web

NPM Package

@stashgg/stash-pay

Playground

Live config and callback playground.

Install the SDK

The package supports three integration modes from one install:
  • React component (@stashgg/stash-pay)
  • Framework-agnostic API (@stashgg/stash-pay/vanilla)
  • Script-tag UMD bundle (window.StashPay.open(...))

Presentation modes

React component

Use this when checkout state is controlled by your app UI and component lifecycle.

Vanilla API

Use this when you want framework-agnostic control.

Script-tag UMD (WebGL-friendly)

Use this in plain HTML or embedded game contexts (including Unity WebGL pages).

Available parameters

The SDK options are shared across React, vanilla, and UMD integrations (except where noted).
For the full and always up-to-date API surface, refer to the package docs on npm: @stashgg/stash-pay.

Open checkout from websites and WebGL shells

For web games and launcher-style web surfaces, keep checkout orchestration at the page shell level:
  1. Request checkout URL from your backend
  2. Open Stash Pay from React, vanilla API, or UMD bridge
  3. Handle callbacks for UX updates
  4. Confirm final purchase state on backend before granting entitlements
For WebGL, the most common pattern is the UMD entry point from the host page and event handoff between game runtime and page JavaScript.

Playground and implementation testing

Use the Stash Pay Playground to:
  • test checkout URL behavior quickly
  • validate config changes and visual options
  • inspect callback events in real time

Detailed references