A minimal demo app showing headless integration with the Hyperswitch Payment SDK using saved card CVC confirmation and full payment element flows.
- Node.js 18+
- A Hyperswitch account with API keys
-
Clone and install
git clone <repo-url> cd hyperswitch-demo npm install
-
Configure environment
Copy the example env file and fill in your credentials:
cp .env.example .env
Variable Description HYPERSWITCH_PUBLISHABLE_KEYYour publishable key HYPERSWITCH_SECRET_KEYYour secret key HYPERSWITCH_SERVER_URLHyperswitch server URL HYPERSWITCH_CLIENT_URLHyperswitch client URL PROFILE_ID(Optional) Profile ID -
Build and run
npm run build npm run serve
-
Development (hot reload)
npm run dev
src/
components/PaymentModal.tsx # Payment modal (CVC + Payment screens)
App.tsx # Root component
utils.ts # API helpers
types.ts # Type definitions
styles.css # Styles
index.tsx # Entry point
server/
index.js # Express backend
- CVC Screen — Saved card last4 + CVC input, amount selector ($100/$150/$200), deposit button. Amount changes trigger
updateIntent. - Payment Screen — Full
PaymentElementwith cards, Apple Pay, Google Pay.
MIT