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

# Partner Secure Elements (PSE)

> Display sensitive card information and manage PINs securely in your client application using PSE SDK (PSE version 3 with EIP-712 two-factor authentication).

## Overview

If you want to display sensitive information (such as card numbers or PINs) in your front-end, you'll need to interact with our **Partner Secure Elements (PSE)** service. The easiest way to do this is by using the [PSE SDK](https://www.npmjs.com/package/@gnosispay/pse-sdk) from Gnosis Pay.

To initialize the SDK, you'll need:

* An `App ID` provided to you upon registration with Gnosis Pay
* An **ephemeral-token** retrieved from the PSE authenticated API using mTLS authentication
* The **public iframe host** for the environment you are calling (`iframeHost` on the SDK)
* An **auth module token** obtained through the [SIWE authentication flow](https://docs.gnosispay.com/guides/auth-with-siwe.md)
* An **EIP-712 signature** and **nonce** obtained from the challenge flow described below

> [!NOTE]
>
> **PSE version 3** adds an EIP-712 wallet signature as a second factor for every sensitive operation. Pass `pseVersion: 3` when constructing the SDK and include `eip712Signature` and `eip712Nonce` obtained from the challenge flow described below.
>
> Note: `pseVersion` refers to the PSE SDK protocol version and is unrelated to the Gnosis Pay API path (which remains `/v2`).

> [!WARNING]
>
> **Backend Required**: mTLS authentication can only be performed from a
> back-end. You need a back-end responsible for retrieving the
> ephemeral-token and sending it to your front-end upon request. We'll go
> through each step in this guide.

Once your front-end has the ephemeral-token and auth module token, it can initialize the PSE SDK and use it to display secure elements.

Here's a diagram showing each step:

```mermaid theme={null}
    sequenceDiagram
        participant FE as Your Frontend
        participant BE as Your Backend
        participant UA as User Api
        participant PSE as PSE API

        FE->>UA: SIWE Login
        UA-->>FE: authModuleToken (15min access token)

        FE->>BE: Request ephemeral-token
        BE->>PSE: POST /api/v1/ephemeral-token (mTLS)
        PSE-->>BE: ephemeral-token
        BE-->>FE: ephemeral-token

        FE->>UA: GET /pci/cards/{cardId}/challenge?action=...
        UA-->>FE: EIP-712 typed data (domain, types, message, nonce)
        Note over FE: User signs typed data in wallet

        Note over FE: Initialize PSE SDK (PSE version 3) with<br/>ephemeralToken, authModuleToken, appId, iframeHost,<br/>eip712Signature, eip712Nonce

        FE->>PSE: SDK requests card data
        PSE->>UA: Verifies EIP-712 signature + nonce
        UA-->>PSE: Signature valid
        PSE-->>FE: Renders card data in secure iframe
```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.