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

# Embed the Affinda validation interface

> Embed the Affinda document validation interface inside your own application using iframes or SSO, including configuration options and authentication tokens.

Using Affinda in 'Embedded Mode' enables users to integrate Affinda’s document validation UI directly into their own applications, creating a seamless experience for end-users. This method is designed to keep users within your application ecosystem while leveraging Affinda’s powerful extraction and processing capabilities.

<AccordionGroup>
  <Accordion title="In-app data display">
    Processed documents and extracted data are rendered directly within your application, removing the need for users to log in to multiple platforms.
  </Accordion>

  <Accordion title="Data integrity">
    Delivers the benefits of a 'human in the loop' solution to ensure the data extracted is 100% accurate.
  </Accordion>

  <Accordion title="Instant learning loop">
    When using the validation UI, the data from these user corrections creates a feedback loop that improves model performance over time.
  </Accordion>

  <Accordion title="Real-time integration">
    Data is processed and made available instantly for users.
  </Accordion>

  <Accordion title="Customizable experience">
    Adjust the interface to align with your branding and user experience requirements.
  </Accordion>
</AccordionGroup>

## How it works

1. Within the API or webhook response from any documents sent to Affinda, we return a value called `meta.reviewUrl`
2. This signed and authenticated URL can be embedded as an iFrame within your platform (or open as a new tab in the browser), and allow members of your team to validate the predicted data and add any additional data points
3. Once a document is 'Confirmed', the validated data can be requested or, more commonly, sent via a [<u>webhook</u>](https://docs.affinda.com/docs/webhooks)
4. This data is ingested into your platform for downstream processing with full confidence in the accuracy

## Implementation

For security reasons, each signed URL is valid for 60 minutes.

<Expandable title="why the url is valid for 60 minutes">
  The review link you receive contains an embedded access token. Because it’s part of the URL, it can easily show up in places you don’t control — like server logs, browser history, referrer headers, email threads, support tickets, or even old backups. If someone gets hold of that URL, they can use it to access the content without logging in. By making these links expire quickly, we reduce the potential impact if one leaks. Even if a database backup or log file were exposed later, any captured links would no longer work.
</Expandable>

We recommend that users treat the URL as ephemeral and fetch it on demand:

1. **Store only the Affinda document ID** in your system, not the review URL.
2. **When a user needs to view a document**, your backend requests a fresh review URL from Affinda (using `GET / document`) and returns it to the client.
3. **Embed that URL in an iframe** in your application (or open it directly if preferred).
4. **Do not persist the URL** anywhere durable; consider it single-use/short-lived.

<Tip>
  **Hygiene:** avoid putting the URL in emails, analytics, or logs; pass it directly from your backend
</Tip>

## Configuration Options

To customize the theme in embedded mode, get in [contact with the Affinda team. ](https://www.affinda.com/contact)

<AccordionGroup>
  <Accordion title="Colour Palette">
    * Light or dark mode
    * Background colour
    * Text colour
    * Primary colour (pink by default)
    * Error colour (red)
    * Warning colour (orange)
    * Info colour (blue)
    * Success colour (green)
    * Annotation colour (yellow)
  </Accordion>

  <Accordion title="Border radius">
    * Used for anything with rounded corners, eg., buttons, annotations, popovers
  </Accordion>

  <Accordion title="Font family">
    * Font family (system font by default; can use any system font, Adobe Fonts, Google Fonts)
    * Base font size
    * Font weights (regular, medium, bold)
  </Accordion>

  <Accordion title="Actions">
    The following actions / capabilities can be enabled or disabled:

    * Confirm document
    * Collection selector
    * Export data
    * Filename
    * Tags
    * Warnings
  </Accordion>
</AccordionGroup>

<Warning>
  Theming customisations are only available in Embedded Mode, not when using the main Affinda application.
</Warning>
