@chargehive/types
v2.7.9
Published
Public TypeScript definitions for the [ChargeHive](https://chargehive.com) browser SDK — a unified interface for cards, Apple Pay, Google Pay and PayPal, with 3‑D Secure authentication and fraud detection, loaded on your checkout page.
Readme
@chargehive/types
Public TypeScript definitions for the ChargeHive browser SDK — a unified interface for cards, Apple Pay, Google Pay and PayPal, with 3‑D Secure authentication and fraud detection, loaded on your checkout page.
These types describe the window.ChargeHive API and its events, charge/address models and
field‑validation schemas. They are published for editor autocompletion and type‑checking; the
runtime itself is the chargehive.min.js bundle served from the CDN (see Installation).
Installation
Environments
ChargeHive runs two merchant-facing environments on separate domains. Choose the matching CDN
host in your <script> src — the SDK's backend API origin is baked into each build, so the host
you load from also selects the environment your payments run against.
| Environment | Use for | CDN host |
| -------------- | -------------------------- | ---------------------------- |
| Production | live traffic | https://cdn.paymentauth.com |
| Sandbox | testing and integration | https://cdn.paymentauth.dev |
The examples below use the production host; swap in cdn.paymentauth.dev to load the sandbox build.
1. Load the SDK on your checkout page
Pin to a specific version and add a Subresource Integrity hash so the browser refuses a tampered bundle:
<script
src="https://cdn.paymentauth.com/merchant/v2.7.9/chargehive.min.js"
crossorigin="anonymous"
integrity="sha384-…"></script>The integrity value for this version is published alongside the bundle — fetch it and paste it
into the tag above:
- SRI hash (plain text): https://cdn.paymentauth.com/merchant/v2.7.9/chargehive.min.js.sri
- Integrity manifest (JSON): https://cdn.paymentauth.com/merchant/v2.7.9/integrity.json
curl -s https://cdn.paymentauth.com/merchant/v2.7.9/chargehive.min.js.sri
# -> sha384-…Always‑latest (no pinning): for a rolling build that tracks the newest
v2release, usehttps://cdn.paymentauth.com/merchant/latest/v2/chargehive.min.js. Because the URL is not version‑specific its SRI hash changes on every release, so it cannot be pinned withintegrity. Pin to a version for production.
2. Install the type definitions
npm install --save-dev @chargehive/typesThe window.ChargeHive global is typed automatically once the package is installed.
Changelog
Notable, merchant‑facing changes to the Chargehive SDK. Each version links to its npm page.
Unreleased
- Apple Pay now works in non‑Safari browsers (Chrome, Edge, Firefox), where the customer completes the payment on a nearby iPhone. No integration change is required.
- Apple Pay
capabilityevents now include anativeflag —truefor Safari's built‑in button,falsefor the cross‑browser button — and reliably reporthasPaymentMethodwhen you setreportExistingMethodorrequireExistingMethod. - Apple Pay now emits a single
capabilityevent with its final result, instead of an initial event followed by a corrected one, so listeners no longer see an intermediate value.
2.7.8
- PayPal: the wallet button no longer stalls indefinitely if eligibility lookup hangs — it now fails fast so the rest of the payment form stays usable.
