> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Glossary

> Definitions of key terms used throughout the Primer Checkout documentation.

A reference of terms used throughout the Primer Checkout documentation. If you encounter an unfamiliar term while reading another guide, you can look it up here.

## Primer Platform

<Accordion title="Client Session">
  A server-side object you create through the [Primer API](/checkout/client-session) before rendering the checkout. The client session holds everything Primer needs to present the correct payment experience: the order amount, currency, customer information, and which payment methods are available. Creating a client session returns a **client token**.
</Accordion>

<Accordion title="Client Token">
  A short-lived string returned when you [create a client session](/checkout/client-session). You pass it to the checkout component to initialize the session.

  <Tabs>
    <Tab title="Web">
      ```html theme={"dark"}
      <primer-checkout client-token="your-client-token"></primer-checkout>
      ```
    </Tab>

    <Tab title="Android">
      ```kotlin theme={"dark"}
      val checkout = rememberPrimerCheckoutController(clientToken = "your-client-token")
      ```
    </Tab>

    <Tab title="iOS">
      ```swift theme={"dark"}
      PrimerCheckout(clientToken: "your-client-token")
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Primer Dashboard">
  The web interface where you configure your Primer account. From the Dashboard you can enable payment methods, set up processors, manage API keys, and configure checkout behavior — all without changing your frontend code.
</Accordion>

<Accordion title="Diagnostics ID">
  A unique identifier attached to every error the SDK produces. When you contact Primer support about a failed payment or unexpected behavior, include the `diagnosticsId` so the team can locate the exact request in their logs.

  <Tabs>
    <Tab title="Web">
      ```javascript theme={"dark"}
      checkout.addEventListener('primer:payment-failure', (event) => {
        const { error } = event.detail;
        console.error('Payment failed:', error.diagnosticsId);
      });
      ```
    </Tab>

    <Tab title="Android">
      ```kotlin theme={"dark"}
      onEvent = { event ->
          when (event) {
              is PrimerCheckoutEvent.Failure -> {
                  Log.e("Checkout", "diagnosticsId: ${event.error.diagnosticsId}")
              }
          }
      }
      ```
    </Tab>

    <Tab title="iOS">
      ```swift theme={"dark"}
      if case .failure(let error) = state {
        print("Payment failed: \(error.diagnosticsId ?? "N/A")")
      }
      ```
    </Tab>
  </Tabs>
</Accordion>

## SDK & Architecture

<Accordion title="Primer Checkout SDK">
  The client-side package that provides checkout UI components, payment logic, and event system. Available for Web (`@primer-io/primer-js`), Android (`io.primer:checkout`), and iOS (`PrimerSDK`).
</Accordion>

<Accordion title="Web Components (Web)">
  A set of browser-native APIs for creating reusable, encapsulated UI elements. The Web SDK is built on Web Components, which means its elements (like `<primer-checkout>` and `<primer-card-form>`) work in any framework. See [Core Concepts](/checkout/primer-checkout/core-concepts).
</Accordion>

<Accordion title="Shadow DOM (Web)">
  A browser feature that isolates a component's internal HTML and CSS from the rest of the page. Every Web SDK component uses Shadow DOM. Because external CSS selectors can't reach inside, you customize appearance through **CSS variables** instead.
</Accordion>

<Accordion title="Controller (Android)">
  A state holder created with a `remember*` function (e.g., `rememberPrimerCheckoutController()`). Provides observable state via `StateFlow` and action methods. Follows the standard Jetpack Compose pattern.
</Accordion>

<Accordion title="Composable (Android)">
  A Kotlin function annotated with `@Composable` that describes a piece of UI. All Android SDK components are Composables that integrate naturally with Jetpack Compose.
</Accordion>

<Accordion title="StateFlow (Android)">
  A Kotlin coroutines type for observable state. The SDK uses `StateFlow<PrimerCheckoutState>` for reactive UI updates. Collect with `collectAsStateWithLifecycle()` in Compose.
</Accordion>

<Accordion title="Scope (iOS)">
  A typed protocol that exposes the state, actions, and customization points for a specific part of the checkout. Scopes (e.g., `PrimerCheckoutScope`, `PrimerCardFormScope`, `PrimerPaymentMethodSelectionScope`) are the primary API surface for Primer Checkout iOS.
</Accordion>

<Accordion title="AsyncStream (iOS)">
  A Swift concurrency primitive used to observe state changes over time. Each scope exposes its state as `AsyncStream<State>`. Observe with `for await state in scope.state`.
</Accordion>

<Accordion title="PrimerCheckoutPresenter (iOS)">
  A UIKit helper class that presents `PrimerCheckout` as a modal sheet from a `UIViewController`. Use this when integrating the SDK in a UIKit-based app.
</Accordion>

<Accordion title="Customization point">
  A predefined area in a component where you can insert your own content. On Web, these are named HTML slot placeholders. On Android, these are `@Composable` lambda parameters (e.g., the `submitButton` parameter on `PrimerCardForm`). On iOS, these are closure properties on scopes that return `AnyView`.
</Accordion>

<Accordion title="Design Token">
  A named value (color, spacing, font size, corner radius) used to style components consistently. On Web, these are CSS variables (e.g., `--primer-color-brand`). On Android, they are properties in `PrimerTheme`. On iOS, they are properties in `PrimerCheckoutTheme`.
</Accordion>

<Accordion title="Defaults Object (Android)">
  An object (e.g., `CardFormDefaults`, `PrimerCheckoutSheetDefaults`) that provides pre-built sub-components. Use them to customize specific parts while keeping others at their defaults.
</Accordion>

<Accordion title="Hosted Input (Web)">
  A card input field that renders inside a secure iframe managed by Primer. Sensitive card data never touches your page's DOM, keeping your integration PCI-compliant.
</Accordion>

## Payment Concepts

<Accordion title="Payment Method">
  A way for a customer to pay — for example, a credit card, PayPal, Apple Pay, or Google Pay. Available payment methods are configured in the Primer Dashboard and delivered to the SDK through the client session. Each method has a type string such as `PAYMENT_CARD`, `PAYPAL`, or `APPLE_PAY`.
</Accordion>

<Accordion title="Vault / Vaulted Payment Methods">
  Primer's system for securely storing a customer's payment details for future use. When vaulting is enabled, returning customers can pay with a saved card or payment method without re-entering their details. The SDK exposes vault data through the `primer:vault-methods-update` event and the `<primer-vault-manager>` component. See [SDK Options — Vault](/checkout/primer-checkout/configuration/sdk-options).
</Accordion>

<Accordion title="Payment Instrument Data">
  The details associated with a saved (vaulted) payment method. For a stored card this includes properties like `network` (e.g. `VISA`), `last4Digits`, `expirationMonth`, and `expirationYear`. You access it via the `paymentInstrumentData` property on a vaulted payment object.
</Accordion>

<Accordion title="PCI Compliance">
  The Payment Card Industry Data Security Standard (PCI DSS). Primer Checkout handles card data securely so that sensitive information never enters your application, significantly reducing your PCI compliance scope.
</Accordion>

<Accordion title="3DS (3D Secure)">
  An authentication protocol that adds a verification step during card payments, typically a bank-issued challenge screen or biometric prompt. Primer Checkout handles 3DS flows automatically with no additional code required.
</Accordion>

<Accordion title="AUTO Payment Handling">
  The default payment flow where the SDK processes the payment end-to-end. You receive success or failure events. On Web, this is the default mode. On Android, the composable module operates exclusively in AUTO mode.
</Accordion>

<Accordion title="Co-badge">
  A card that belongs to multiple card networks (e.g., both Visa and Cartes Bancaires). The SDK shows a network selector for co-badged cards.
</Accordion>

## Events

<Accordion title="primer:ready">
  The event fired when the SDK has fully initialized and is ready for interaction. Inside this event's handler you access the PrimerJS instance (`event.detail`) which provides SDK methods like `refreshSession()`, `getPaymentMethods()`, and `setCardholderName()`. See [Events Guide](/checkout/primer-checkout/configuration/events).

  On Android, the equivalent is observing `checkout.state` for `PrimerCheckoutState.Ready` via `StateFlow`.
</Accordion>

<Accordion title="primer:payment-success / primer:payment-failure">
  The events fired after a payment completes. `primer:payment-success` fires after a successful payment and the event detail includes the payment summary (order ID, last 4 digits, network). `primer:payment-failure` fires after a failed payment and includes the error object with the `diagnosticsId`. These are your primary integration points for redirects, confirmations, and error logging.

  ```javascript theme={"dark"}
  checkout.addEventListener('primer:payment-success', (event) => {
    const { payment } = event.detail;
    window.location.href = `/confirmation?order=${payment.orderId}`;
  });

  checkout.addEventListener('primer:payment-failure', (event) => {
    const { error } = event.detail;
    console.error('Payment failed:', error.diagnosticsId);
  });
  ```

  On Android, handle `PrimerCheckoutEvent.Success` and `PrimerCheckoutEvent.Failure` in the `onEvent` callback.

  On iOS, observe `checkoutScope.state` for `.success(result)` and `.failure(error)` cases, or use the `onCompletion` callback.
</Accordion>

<Accordion title="primer:payment-start">
  The event fired when payment creation begins. You can intercept this event with `event.preventDefault()` to run validation before the payment is created. The event detail includes `continuePaymentCreation()` and `abortPaymentCreation()` handlers to control the payment flow. See [Events Guide](/checkout/primer-checkout/configuration/events) for usage.

  On Android, payment interception is not available in the Composable module. Use the headless API (`onBeforePaymentCreated`) if you need this capability.

  On iOS, use the `onBeforePaymentCreate` handler on the checkout scope for payment interception.
</Accordion>

## Integration Modes

<Accordion title="Drop-in (Sheet / Full Component)">
  An integration mode that provides a complete checkout flow with minimal code. On Web, use `<primer-checkout>`. On Android, use `PrimerCheckoutSheet`. On iOS, use `PrimerCheckout` as a SwiftUI view or `PrimerCheckoutPresenter` for UIKit. The SDK handles navigation between screens.
</Accordion>

<Accordion title="Inline (Custom Layout)">
  An integration mode where you embed individual checkout components in your own layout. On Web, use individual components like `<primer-card-form>`. On Android, use `PrimerCheckoutHost` with child composables. On iOS, use the `scope` closure to access `PrimerCardFormScope` and build custom form layouts. You control navigation and layout.
</Accordion>
