Card
The card-collection element. Wraps an Evervault card iframe and, when configured, renders billing-address and identity-field sections alongside it.
Construct via frame.createElement('card', options) — do not call the constructor directly.
Listen for change and complete events to drive your submit button's enabled state. Pass the instance to frame.confirmCardPayment when the customer is ready to pay.
import Frame from '@framepayments/frame-js';
const frame = await Frame.init('pk_test_...');
const card = await frame.createElement('card', { billing: true });
card.on('complete', () => {
submitButton.disabled = false;
});
card.mount('#card-container');
Element options
When true, renders a billing address form below the card iframe.
Theme object for the Evervault card iframe. Use frame.cardTheme(preset) to construct one. Styles only the card iframe — does not affect billing address or identity fields.
When set, renders an identity-fields section above the card iframe.
Any remaining keys are forwarded to the Evervault card iframe (autoFocus, fields, translations, etc.). See Evervault's docs for the full list.