Embeds · Guide
Show a traffic list
<provenance-traffic-list> lists the visits Identify's hosted check assessed (each a traffic assessment) for your staff, inside your own admin tool, newest first. Each row is one line: what Identify did to the request with a dot, who visited (the agent's operator, or agent or person), whether the agent signed the request, the bot likelihood and the time. Your staff filter it, sort it and page through it; a selected row opens in a panel beside the rows.
Before you begin: a publishable key (see embeds) and a secret key with the identify scope. The embed needs Pro or the Free trial in live, and works on any plan in sandbox; the same rows show on the console's Traffic page on every plan.
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
1. Mint a list session on your server
Your server mints a short session for the list with POST / and widget: "traffic_list". A list takes no object_id: it's scoped to your account. 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": "traffic_list", "filters": { "outcome": "block" }, "ttl": 900 }'
// GET /admin/provenance/session?widget=traffic_list (your route, behind your staff sign-in)
const session = await prov.embed.createToken({ widget: "traffic_list", filters: { outcome: "block" }, ttl: 900 });
res.json({ token: session.embedToken });
token = prov.embed.create_token(widget="traffic_list", filters={"outcome": "block"}, ttl=900)["embed_token"]
session, err := embed.CreateToken(ctx, pv.EmbedTokenParams{
Widget: pv.WidgetTrafficList,
Filters: &pv.TrafficListFilters{Outcome: "block"},
TTL: 900,
})
| Field | What it does |
|---|---|
filters | Optional. Filters the session always applies, which the browser can't change: outcome (the decision: allow, block, challenge and the rest), class (signed_, declared_, suspected_, likely_, unknown), bot_ (low, medium, high, unclassified), each one value or several separated by commas; signed (true or false); created_, created_. Pin outcome: "block" for a page of rejected visits. |
ttl | Seconds, up to 900 (15 minutes). |
A traffic list takes no show. A key without the identify scope gets 403 insufficient_scope. A filter that isn't one of the list's, or a value it doesn't take, is 400 parameter_invalid.
2. Drop the list in your page
npm install @provenance/embed
<script type="module" src="https://unpkg.com/@provenance/embed"></script>
<provenance-traffic-list id="visits" base-url="https://sandbox-api.provenanceauth.com" publishable-key="prv_pub_1D10TzJo8F73Z7ZHhWGKPpn0K7suJ0se"
filters="outcome,visitor,bot,created" page-size="25"></provenance-traffic-list>
<script>
const list = document.querySelector("provenance-traffic-list");
// No context: the list's own session. { objectId, widget }: the session for the row its panel opens.
list.getToken = async ({ objectId, widget } = {}) => {
const q = objectId ? `widget=${widget}&id=${objectId}` : "widget=traffic_list";
return (await (await fetch(`/admin/provenance/session?${q}`)).json()).token;
};
</script>
A selected row opens in the list's own panel: beside the rows on a column 600 px or wider, with the visit's reference, Previous, Next and Close; narrower, as the whole element with Back. One "Powered by Provenance" sits under both.
The panel asks the list's getToken({ objectId, widget: "traffic_result" }) for the visit's ID (tas_…), and your server mints a traffic_result session for exactly that visit, so the list never widens what it can read.
| Attribute | What it does |
|---|---|
filters | The filters shown, from outcome (Allowed, Challenged, Rejected; its label is Action), visitor (Agent, Person, Unknown), signed (Signed, Not signed), bot (Low, Medium, High, Unclassified) and created (Any time, Today, Last 7 days, Last 30 days). outcome,visitor,created when absent. A pinned filter has no tab, chip or menu entry. |
sort | The order on load, one of Newest first (-created) or Oldest first (created). Newest first when absent. |
sorts | The orders the sort button offers, a comma list (for example -created,created). All of them when absent. |
detail | panel (the default) opens a selected row in the list's own panel. none only emits pv:select. |
page-size | Rows per page, 10 to 100. 25 when absent. |
select-first | Select the first row on load (with the panel, it opens on that row). |
Above the rows: tabs for outcome (All, Allowed, Challenged and Rejected), a Filter chip for the other filters you show, a chip for each filter in use (its button removes it) and a sort button that names the current order. Agent means a signed agent, a declared bot or a suspected bot; Person means likely human.
Under the rows, the range ("1–25") and Newer and Older page by cursor, with no page numbers or totals. The filters, the sort and the page stay inside the element; to keep them in your page's address, listen for pv:list_change.
To show the visit somewhere else on your page, set detail="none" and either handle pv:select yourself or put a <provenance-traffic-result for="visits"> beside it (a list that a result element follows never opens its own panel):
list.addEventListener("pv:select", (e) => {
const { kind, id } = e.detail; // kind: "traffic", id: "tas_…"
openVisit(id);
});
In React:
import { ProvenanceTrafficList } from "@provenance/embed/react";
<ProvenanceTrafficList
id="visits"
baseUrl={process.env.NEXT_PUBLIC_PROVENANCE_API!}
publishableKey="prv_pub_1D10TzJo8F73Z7ZHhWGKPpn0K7suJ0se"
filters={["outcome", "visitor", "bot", "created"]}
sort="created"
getToken={async ({ objectId, widget } = {}) => {
const q = objectId ? `widget=${widget}&id=${objectId}` : "widget=traffic_list";
return (await (await fetch(`/admin/provenance/session?${q}`)).json()).token;
}}
/>;
What it shows
Each row, and where it comes from in GET /:
| Part | Example | From |
|---|---|---|
| Action | Allowed, Challenged or Rejected | decision., in the visit words |
| Visitor | Acme Shopper, or Likely human, Suspected bot | agent., else class |
| Detail | Not signed · Bot high | agent., and bot_ |
| Time | 1:23 pm today, Nov 14 before | created_ |
The list's filters are the API list's own, the ones a session can pin (step 1). Only hosted checks are listed; your middleware's reports are traffic decisions. The element never gets the address, a header, the user agent string, timing values, a pseudonym or an agent's ID. To see what it gets, call GET /v1/embed/traffic_list with the session.
Visit words
A visit is one request, so its word says what Identify did to that request, in the words every product uses.
decision.action | Visit word |
|---|---|
allow | Allowed |
challenge | Challenged |
block | Rejected |
log_ | Logged |
rate_ | Rate-limited |
require_ | Asked for a person |
The order's own status (Approved, Challenged, Rejected, In review, Expired) is on the checkout list and the checkout result.
Events
| Event | When | Detail |
|---|---|---|
pv:ready | The session opened | widget, object_, mode |
pv:select | A row was selected (click, Enter or Space) | kind: "traffic", id |
pv:list_ | The filters, the sort or the page changed | filters, cursor, sort |
pv:token_ | getToken() couldn't renew the session | widget |
pv:error | The element couldn't start or read a page | code, message |
Embed, console or your own
| This embed | The console | Your own UI on the API | |
|---|---|---|---|
| Where | Your admin tool | Identify › Traffic, Hosted checks | Anywhere you like |
| Plan | Pro, or the Free trial; any plan in sandbox | Every plan | Every plan |
| Work | Mint two kinds of session, drop one tag | None | Page the list, map the words |
Errors you might see
| Symptom | Cause | Fix |
|---|---|---|
400 embed_ | The page asked for another value of a pinned filter | Leave it out; the session applies it. |
400 parameter_ on sort or cursor | A sort the list doesn't take, or a cursor made in another order | Use an order from the sort row above; start again without the cursor. |
403 insufficient_ | The key has no identify scope | Mint with an Identify key. |
401 embed_ | The session expired or is for another widget | Mint a new one, or give the element getToken(). |
503 embed_ | The list couldn't be read | Retry shortly. |