The Pay Theory Web SDK is a set of fields and components that can be used to collect payment information to tokenize and create payment methods or payments.
For documentation on the SDK, visit docs.paytheory.com.
src/paytheory-sdk.ts is the canonical public contract. npm run build-types emits two standalone
declaration files from it:
dist/paytheory-sdk.d.tsis the partner-facing declaration. Declarations tagged@internalare stripped, so the checkout-portal-only surface (checkoutContext,resendInvoiceEmail) never appears in it. The CDN publication workflows upload this file next toindex.js.dist-internal/paytheory-sdk.d.tskeeps the@internaldeclarations. It exists for the Pay Theory checkout portal, is never uploaded to the CDN, and is copied into that project from a local build.
Partners who load the SDK as a browser script can download the partner declaration into a
TypeScript project (for example, types/paytheory-sdk.d.ts) and make sure the directory is
included by tsconfig.json:
{
"include": ["src", "types"]
}The declaration then provides type safety for the existing browser globals:
await window.paytheory.transact({
amount: 2500,
});Partner code may also import individual types from the downloaded file. This is a type-only import; the SDK implementation must still be loaded through the normal browser script.
import type { TransactProps, TransactResult } from './types/paytheory-sdk';SDK implementation modules also import partner-facing types from this canonical contract. Types used only for internal transport or state remain next to their implementations.
MIT © pay theory