@fluid-app/fluid-payments
v0.1.0
Published
Framework-agnostic JavaScript SDK for integrating Fluid payment methods
Readme
@fluid-app/fluid-payments
Framework-agnostic JavaScript SDK for integrating Fluid payment methods.
Installation
npm install @fluid-app/fluid-payments
# or
pnpm add @fluid-app/fluid-payments
# or
yarn add @fluid-app/fluid-paymentsUsage
ESM (Modern bundlers)
import { FluidPayments } from "@fluid-app/fluid-payments";
const fluid = new FluidPayments({
apiKey: "pk_live_xxx",
environment: "production",
});
// Check available payment methods
const capabilities = await fluid.getCapabilities();
console.log(capabilities); // { applePay: true, googlePay: false, paypal: true }CommonJS
const { FluidPayments } = require("@fluid-app/fluid-payments");
const fluid = new FluidPayments({
apiKey: "pk_live_xxx",
environment: "production",
});Script tag (CDN)
<script src="https://unpkg.com/@fluid-app/fluid-payments"></script>
<script>
const fluid = new FluidPayments.FluidPayments({
apiKey: "pk_live_xxx",
environment: "production",
});
</script>API Reference
FluidPayments
Main SDK class for initializing and managing payment methods.
Constructor
new FluidPayments(config: FluidConfig)Properties
version- Current SDK versionenvironment- Configured environment ('production' | 'sandbox')
Methods
getCapabilities()- Returns available payment methods for current browser
License
MIT
