View as Markdown

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 /v1/embed/tokens, 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 }'
FieldWhat it does
object_idOne capture request (capr_…) of your account. Another kind of ID is 400 embed_object_kind_mismatch; another account's request, or one under a carrier the key doesn't act for, is 404.
showOptional: case_id and metadata add the request's case and metadata to the embed. Nothing else is ever shown.
ttlSeconds, 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 /v1/attest/capture_requests/{id}:

RowExampleFrom
GradeHardware · StrongBox, or Hardware · mixedresult.tier, and each image's tier when they all match (items[].checks[].attestation.tier)
WhereProvenance app · Androidresult.destination, result.platform
PhotosA thumbnail per image, its label and time; a grade only where it differs ("Browser · software")GET /v1/attest/capture_requests/{id}/files
Photos3 photos deleted · hashes keptimages_deleted_at
ScreeningClearitems[].checks[].screening.status
DocumentDriver's license (US) · high, or Not a document · medium · not acceptedThe ID shots' items[].checks[].document (the first one the request doesn't accept, else the first checked); no row when the check didn't run
Risk score35 of 100The highest captured item's items[].risk_score (higher is riskier); the outcome and the checks decide, not the score
ChecksPassed, or Review · the head turn failedresult.checks, result.reasons
Hardware proofRequired · met, or Required · not met: browserrequire_tier, items[].requirement, requirement_reason
Case, MetadataLMB-20418case_id, metadata, only with show
ProofView proofGET /v1/attest/capture_requests/{id}/result, 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.

RowExampleFrom
NetworkOH, United Statesitems[].checks[].context.network.country, region; the city only while the city setting is on
NetworkUnited States · VPN or proxynetwork.vpn_or_proxy, network.hosting_provider
DeviceAndroid 16 · attestedcontext.device.os, os_version, os_attested
Time zoneAmerica/New_Yorkcontext.device.time_zone
LocationDevice GPS · ±12 m, or Declinedcontext.gps.source, accuracy_m, mock; context.unavailable.gps
ClockIn sync, or 2 min aheadcontext.clock_offset_s
Photo metadataMatchescontext.exif

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:

RowExampleWhat it means
(first line)Signed by Provenance · checked just nowThe ES256 signature checks against Provenance's published keys, and the claims are this request's result over the images shown
Keys…/.well-known/jwks.jsonWhere the keys are published (jwks_url)
Signed1:31 pmWhen the result was signed (iat)
RootGoogle · verifiedThe attestation root the image's key chain ends at, checked against the pinned root (images[].chain.root, root_verified)
ChainLeaf › intermediate › rootThe chain was checked link by link
Device keyStrongBox · boundThe key's security level, and whether the signing certificate is the attested key's (key, key_bound)
ChallengeMatchedThe attestation carried the server's one-time challenge (challenge)
SHA-2563f9a2c1d…a8c21bThe start and end of the image's hash (images[].sha256)

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 /v1/attest/capture_requests/{id}/result 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

EventWhenDetail
pv:readyThe session openedwidget, object_id, mode
pv:resultFirst read, and whenever the request changeskind: "capture", status, checks, tier, requirement
pv:token_refresh_failedgetToken() couldn't renew the sessionwidget
pv:errorThe element couldn't startcode, 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 embedThe consoleYour own UI on the API
WhereYour admin toolAttest › Capture requests, the request drawerAnywhere you like
PlanPro, or the Free trialEvery planEvery plan
WorkMint a session, drop the tagNoneMap 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

SymptomCauseFix
400 embed_object_kind_mismatchThe ID isn't a capture requestPass the capr_… ID.
403 insufficient_scopeThe key has no attest scopeMint with an Attest key.
401 embed_token_invalidThe session expired or is for another widgetMint a new one, or give the element getToken().
409 capture_result_not_readyThe proof was asked for before the request was completedThe element shows View proof only once it's completed.
503 embed_result_unavailableThe request, its photos or its signed result couldn't be readRetry shortly.

See also