Embeds · Guide
Show a capture result
<provenance-capture-result> shows one capture request's result to your staff, inside your own admin tool: the hardware grade for the session, the photos while you keep them, screening and checks, whether hardware proof was required and met, the signed proof, checked in the browser, and the context. Every row is one line, with a dot and a word. Beside it, a slot holds your own next step; Provenance shows the facts and never picks the action.
Before you begin: a publishable key (see embeds) and a secret key with the attest scope. The embed needs Pro or the Free trial; the same rows show in the console's capture request drawer on every plan.
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_capture_C4pT9vQ2bW7mK3sYd8cFjLh6gAe1nR5x
1. Mint a session on your server
Your server mints a short session for one request with POST /, widget: "capture_result" and the request's ID. Put it behind a route your admin page calls, after your own sign-in check:
In the SDK tabs, prov (Node, Python) and embed (Go) are your server-side clients, set up as in admin results and requests.
curl -s -X POST $PROVENANCE_API/v1/embed/tokens \
-H "Authorization: Bearer $PROVENANCE_KEY" \
-H "Content-Type: application/json" \
-d '{ "widget": "capture_result", "object_id": "capr_01M7H1GKTWTSCF2VRQNRYTKDGT", "show": ["case_id"], "ttl": 900 }'
// GET /admin/provenance/session?request=capr_… (your route, behind your staff sign-in)
const session = await prov.embed.createToken({ widget: "capture_result", objectId: requestId, show: ["case_id"], ttl: 900 });
res.json({ token: session.embedToken });
token = prov.embed.create_token(widget="capture_result", object_id=request_id, show=["case_id"], ttl=900)["embed_token"]
session, err := embed.CreateToken(ctx, pv.EmbedTokenParams{Widget: pv.WidgetCaptureResult, ObjectID: requestID, Show: []string{"case_id"}, TTL: 900})
| Field | What it does |
|---|---|
object_ | One capture request (capr_) of your account. Another kind of ID is 400 embed_; another account's request, or one under a carrier the key doesn't act for, is 404. |
show | Optional: case_ and metadata add the request's case and metadata to the embed. Nothing else is ever shown. |
ttl | Seconds, up to 900 (15 minutes). |
A key without the attest scope gets 403 insufficient_scope. A copied session opens only this request, and only until it expires.
2. Drop the element in your page
npm install @provenance/embed
<script type="module" src="https://unpkg.com/@provenance/embed"></script>
<provenance-capture-result base-url="https://sandbox-api.provenanceauth.com" publishable-key="prv_pub_1D10TzJo8F73Z7ZHhWGKPpn0K7suJ0se" theme="inherit">
<div slot="actions"><!-- your own Suggested card --></div>
</provenance-capture-result>
<script>
const el = document.querySelector("provenance-capture-result");
el.getToken = async () => (await (await fetch("/admin/provenance/session?request=capr_01M7H1GKTWTSCF2VRQNRYTKDGT")).json()).token;
</script>
3. Keep the session alive with getToken()
An admin page stays open longer than a session. Give the element a getToken() function that asks your server for a fresh token. The element calls it on load (when there's no embed-token attribute) and again one minute before each session ends, then swaps the new session in place, so nothing on screen resets. The new token must be for the same request.
If your server can't answer, the element says Session ended with Reload, and fires pv:token_refresh_failed. An embed-token attribute still works for a page that doesn't renew.
In React:
import { ProvenanceCaptureResult } from "@provenance/embed/react";
<ProvenanceCaptureResult
baseUrl={process.env.NEXT_PUBLIC_PROVENANCE_API!}
publishableKey="prv_pub_1D10TzJo8F73Z7ZHhWGKPpn0K7suJ0se"
getToken={async () => (await (await fetch(`/admin/provenance/session?request=${id}`)).json()).token}
onResult={(r) => setResult(r)}
>
<SuggestedCard result={result} />
</ProvenanceCaptureResult>;
4. Put your own next step in the slot
The actions slot is yours: your card, your labels, your handlers. Decide what to suggest from pv:result, which carries IDs and enums only:
el.addEventListener("pv:result", (e) => {
const { status, checks, tier, requirement } = e.detail;
const card = document.querySelector("#suggested");
// Your rule, in your code: hardware proof and every check passed.
card.hidden = !(status === "completed" && checks === "checks_passed" && tier === "hardware");
});
The slot sits beside the result and can't cover or restyle the grade line, the checks words or the "Powered by Provenance" foot.
What it shows
Each row, and where it comes from in the API, so you can find the same fact in GET /:
| Row | Example | From |
|---|---|---|
| Grade | Hardware · StrongBox, or Hardware · mixed | result., and each image's tier when they all match (items[].) |
| Where | Provenance app · Android | result., result. |
| Photos | A thumbnail per image, its label and time; a grade only where it differs ("Browser · software") | GET / |
| Photos | 3 photos deleted · hashes kept | images_ |
| Screening | Clear | items[]. |
| Document | Driver's license (US) · high, or Not a document · medium · not accepted | The ID shots' items[]. (the first one the request doesn't accept, else the first checked); no row when the check didn't run |
| Risk score | 35 of 100 | The highest captured item's items[]. (higher is riskier); the outcome and the checks decide, not the score |
| Checks | Passed, or Review · the head turn failed | result., result. |
| Hardware proof | Required · met, or Required · not met: browser | require_, items[]., requirement_ |
| Case, Metadata | LMB-20418 | case_, metadata, only with show |
| Proof | View proof | GET /, see View proof |
Photo links last 5 minutes at most, never past the session, and the element fetches new ones before they lapse. If the photos can't be read right now it says Photos unavailable right now, never that they were deleted. A request that can't be read shows that it's unavailable, never a made-up result.
Context
Under Proof, a Context section shows where and on what the photos were taken, one line per signal for the whole session. It appears once a photo has recorded its context, on every plan.
| Row | Example | From |
|---|---|---|
| Network | OH, United States | items[]., region; the city only while the city setting is on |
| Network | United States · VPN or proxy | network., network. |
| Device | Android 16 · attested | context., os_, os_ |
| Time zone | America/New_York | context. |
| Location | Device GPS · ±12 m, or Declined | context., accuracy_, mock; context. |
| Clock | In sync, or 2 min ahead | context. |
| Photo metadata | Matches | context. |
When every photo agrees, the line shows the value. When they differ, it shows the photo that stands out (a VPN, a mock location, a clock more than 10 minutes off, metadata that doesn't match), or Varies by photo. A missing signal says why in a word or two, such as Declined or No IP lookup.
The embed gets the coarse part only: never the coordinates, the language, the device model or the IP address. It never gets a comparison with an address you gave, such as a distance: those are facts for your capture rules, and they appear only in the conditions of the rule that decided, on the API. Each image's context is images[].context in GET /v1/embed/capture_result. After the photos are deleted the context stays, without the city.
The element never receives the person's contact, the capture link, the delivery messages or the timeline. To see what it gets, call GET /v1/embed/capture_result with the session.
View proof
Once the request is completed, the Proof row has a View proof button. It opens a sheet inside the element that checks the signed result in your staff member's browser, so your page shows a check you didn't have to write:
| Row | Example | What it means |
|---|---|---|
| (first line) | Signed by Provenance · checked just now | The ES256 signature checks against Provenance's published keys, and the claims are this request's result over the images shown |
| Keys | …/.well-known/jwks.json | Where the keys are published (jwks_) |
| Signed | 1:31 pm | When the result was signed (iat) |
| Root | Google · verified | The attestation root the image's key chain ends at, checked against the pinned root (images[]., root_) |
| Chain | Leaf › intermediate › root | The chain was checked link by link |
| Device key | StrongBox · bound | The key's security level, and whether the signing certificate is the attested key's (key, key_) |
| Challenge | Matched | The attestation carried the server's one-time challenge (challenge) |
| SHA-256 | 3f9a2c1d…a8c21b | The start and end of the image's hash (images[].) |
A photo taken in the browser has no device chain: its rows say None · browser capture and Live page nonce, the one-time value from Provenance's capture page that the photo was bound to.
If the keys can't be fetched the sheet says Couldn't check the signature; if the signature or the claims don't match it says Signature doesn't match. Either way it shows no chain rows, never a pass it couldn't check. An open sheet stays open when the session renews, and Close or Escape returns to the result.
The sheet reads GET /v1/embed/capture_result/proof: the signed result (token) and jwks_url, nothing else. Its claims are the ones GET / returns to your server, except that case_id is there only when the session was minted with show: ["case_id"]. To check a result on your own server, verify that endpoint's token against its jwks_url.
Events
| Event | When | Detail |
|---|---|---|
pv:ready | The session opened | widget, object_, mode |
pv:result | First read, and whenever the request changes | kind: "capture", status, checks, tier, requirement |
pv:token_ | getToken() couldn't renew the session | widget |
pv:error | The element couldn't start | code, message |
While the person is still capturing, the element reads the request again every 15 seconds. Confirm a decision on your server from the webhook, never from the event alone.
Embed, console or your own
| This embed | The console | Your own UI on the API | |
|---|---|---|---|
| Where | Your admin tool | Attest › Capture requests, the request drawer | Anywhere you like |
| Plan | Pro, or the Free trial | Every plan | Every plan |
| Work | Mint a session, drop the tag | None | Map the fields, check the signed result, fetch file links |
To build your own, read the request, its signed result and its files from your server; the table above names the field behind each row.
Errors you might see
| Symptom | Cause | Fix |
|---|---|---|
400 embed_ | The ID isn't a capture request | Pass the capr_ ID. |
403 insufficient_ | The key has no attest scope | Mint with an Attest key. |
401 embed_ | The session expired or is for another widget | Mint a new one, or give the element getToken(). |
409 capture_ | The proof was asked for before the request was completed | The element shows View proof only once it's completed. |
503 embed_ | The request, its photos or its signed result couldn't be read | Retry shortly. |