@flopay/js 1.3.4 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,7 +24,13 @@ const flopay = await loadFloPay('pk_test_...', {
24
24
  });
25
25
  ```
26
26
 
27
- `loadFloPay` caches the instance -- calling it again with the same key returns the cached `FloPay` instance. The optional second argument accepts a `FloPayConfig` with `billingApiUrl`, `locale`, and `appearance`.
27
+ `loadFloPay` caches by publishable key and behavior-affecting options. Concurrent
28
+ calls with the same key and options share one in-flight provider initialization
29
+ and resolve to the same `FloPay` instance. A failed initialization is evicted so
30
+ a later call can retry. The optional second argument accepts
31
+ `Omit<FloPayConfig, 'publishableKey'>`, including `billingApiUrl`, `locale`,
32
+ `appearance`, and `telemetry`; set `telemetry: false` to opt out of privacy-safe
33
+ operational telemetry.
28
34
 
29
35
  ### Create and Mount Elements
30
36
 
@@ -233,16 +239,46 @@ try {
233
239
 
234
240
  ## API Reference
235
241
 
242
+ ## Privacy-safe operational telemetry
243
+
244
+ Browser telemetry is enabled by default and is best-effort. It reports only
245
+ the closed SDK error/lifecycle/performance taxonomy through a Flo-owned API;
246
+ it never bundles Sentry, reads Resource Timing, persists a queue, or transmits
247
+ payment/customer/form data, credentials, URLs, provider payloads, arbitrary
248
+ messages, or stacks. Existing merchant callbacks remain available with their
249
+ existing arguments and invocation order. Callback exceptions and rejected
250
+ promises are contained and logged only to the merchant console; they are not
251
+ uploaded as SDK telemetry.
252
+
253
+ ```ts
254
+ const flopay = await loadFloPay('pk_live_…', {
255
+ telemetry: false, // merchant opt-out
256
+ });
257
+
258
+ const api = new PaymentAPI(billingApiUrl, { telemetry: false });
259
+ const vault = new PciVaultCardCapture({ telemetry: false });
260
+ await createCheckoutSession({ /* normal checkout fields… */ telemetry: false });
261
+ ```
262
+
263
+ There is no custom telemetry endpoint or enrichment option. See
264
+ [`docs/TELEMETRY.md`](../../docs/TELEMETRY.md) for collected categories,
265
+ exclusions, unauthenticated beacon transport, failure isolation, retention,
266
+ and rollout gates.
267
+
268
+ The same default-on behavior and boolean opt-out apply to direct `FloPay`,
269
+ `PaymentAPI`, `createCheckoutSession`, `createCheckoutSessionWithRetries`, and
270
+ `PciVaultCardCapture` usage.
271
+
236
272
  ### Exports
237
273
 
238
274
  | Export | Description |
239
275
  |--------|-------------|
240
- | `loadFloPay(publishableKey, options?)` | Initializes the SDK. Returns a `Promise<FloPay>`. Caches by key. |
276
+ | `loadFloPay(publishableKey, options?)` | Initializes the SDK. Returns a `Promise<FloPay>`. Shares successful and in-flight work by key; failed work remains retryable. |
241
277
  | `FloPay` | Main SDK class. Methods: `elements()`, `submitElements()`, `createPaymentMethod()`, `confirmCardPayment()`, `cardCapture()`, `confirmPayment()`, `confirmPayPalPayment()`, `resumePayPalPayment()`, `retrieveSession()`, `retrieveUnifiedSession()`, `getRawProvider()`, `destroy()` |
242
278
  | `FloPayElements` | Element group manager. Methods: `create(type, options?)`, `getElement(type)`, `submit()`, `destroy()` |
243
279
  | `StripeAdapter` | `PaymentProviderAdapter` implementation for Stripe |
244
280
  | `PciVaultCardCapture` | `CardCaptureAdapter` implementation that injects the backend-served hosted vault card widget. See [Vault card capture](#vault-card-capture). |
245
- | `PaymentAPI` | Billing API client. Methods: `getCheckoutSession()`, `getVaultCapture()`, `getUnifiedCheckoutSession()`, `processPayment()`, `waitForCheckoutSessionCompletion()`, `createPaymentIntent()`, `createSetupIntent()`, `getPaymentsByEmail()` |
281
+ | `PaymentAPI` | Billing API client. Methods: `getCheckoutSession()`, `getVaultCapture()`, `getUnifiedCheckoutSession()`, `processPayment()`, `waitForCheckoutSessionCompletion()`, `createPaymentIntent()`, `createSetupIntent()`, `getPaymentsByEmail()`, `destroy()` |
246
282
  | `createCheckoutSession(options)` | Creates a checkout session and redirects. Returns `CheckoutSessionResult`. |
247
283
  | `createCheckoutSessionWithRetries(options)` | Same as above with automatic retries (default 3, exponential backoff). |
248
284