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

# Overview

> When to use the widget instead of the API, and how it fits together.

The Pruva widget is a drop in, browser based flow for the checks that need the end user to do something: take a selfie, prove liveness, or photograph an ID. You embed one button; the widget handles the camera, the capture, and the verification.

## Widget or API?

<CardGroup cols={2}>
  <Card title="Use the widget" icon="window">
    When the end user is in a browser and must present themselves or a document: liveness, selfie to ID matching, or NIN/BVN photo matching. You never touch the images.
  </Card>

  <Card title="Use the API" icon="code">
    When you already hold the data and are verifying server to server: a NIN number, a BVN, a company lookup. See the [API reference](/api-reference/overview).
  </Card>
</CardGroup>

The two are complementary. A common pattern is to run the widget for liveness and document capture at onboarding, and the API for identifier lookups behind the scenes.

## How it fits together

<Steps>
  <Step title="Create a widget in the dashboard">
    Pick its type and customize its look. Each widget has a **public key**, which is safe to put in a page.
  </Step>

  <Step title="Embed one button">
    Drop in the script tag and a button carrying your widget's public key. See [Embedding the widget](/widgets/embedding).
  </Step>

  <Step title="The user completes the flow">
    The widget opens, guides the user through the steps, and runs the verification.
  </Step>

  <Step title="You receive the result">
    Read it in the dashboard, or receive it in real time with a [webhook](/widgets/webhooks).
  </Step>
</Steps>

## Public keys, not API keys

A widget authenticates with a **public key** (`pub_...`), not your secret API key. A public key is safe to ship to the browser: it can only open the widget flows you configured, and it cannot run arbitrary API scopes. Never put a `pruva_live_...` API key in a page; that belongs on your server only.

<Note>
  The widget's own verification calls go to Pruva directly. Your API key is not involved in the widget flow at all.
</Note>
