Swipelux
Client-side integration

Widget customization

Complete guide to customizing the Swipelux onramp widget

Overview

The Swipelux widget can be extensively customized to match your application's needs and branding. This section provides detailed documentation for all available customization options, organized by category.

Quick reference

Here's the complete TypeScript interface for widget settings:

export type WidgetSettings = {
  /**
   * Merchant API key in UUID format.
   * @example "123e4567-e89b-12d3-a456-426655440000"
   */
  apiKey: string;
  /**
   * URL where the widget is hosted.
   * @default "https://app.swipelux.com"
   */
  widgetUrl?: string;
  /**
   * Order token, used for prepared orders.
   * @example "ord_123xyz"
   */
  orderToken?: string;
  /**
   * Preferred payment channel.
   * @example "CARD_PAYMENT"
   */
  paymentChannel?: PaymentChannel;
  /**
   * Available payment currency code.
   * @example "USD"
   */
  availablePayCurrency?: string;
  /**
   * Available receive currency configuration.
   * Accepts a string like "BTC", "ETH", etc., or an object with code and protocol.
   * @example "BTC"
   * @example { code: "ETH", protocol: "ERC20" }
   */
  availableReceiveCurrency?: string | CurrencyReference;
  /**
   * Default form values.
   * @example { email: { value: "user@example.com", editable: false } }
   */
  defaultValues?: DefaultValues;
  /**
   * Theme color overrides.
   * @example { main: "#FF0000", background: "#FFFFFF" }
   */
  colors?: Partial<ThemeColors>;
  /**
   * External ID resolver.
   * @example "ext_123"
   * @example async () => await getExternalIdFromServer()
   */
  externalId?: ExternalIdResolver;
  /**
   * Force creation of a new transaction.
   * @example true
   */
  forceNewTransaction?: boolean;
  /**
   * Auto-close the widget on a successful transaction.
   * @example true
   */
  closeOnSuccess?: boolean;
  /**
   * Widget bottom signature/branding customization.
   * @example { text: "Powered by BestCompany", logoUrl: "https://example.com/my-logo.png" }
   */
  signature?: Signature;
}

Basic setup

const widget = new SwipeluxWidget({
  apiKey: "YOUR_PUBLISHABLE_API_KEY",
  // Add customization options here
});
 
widget.mount(document.getElementById("swipelux-container"));

Customization categories

Appearance and branding

User experience

Transaction configuration

On this page