const hasToken = await Document.hasPrivateToken(`issuer.example`);
if (!hasToken) {
await fetch(
"https://issuer.example/.well-known/private-state-token/issuance",
{
method: "POST",
privateToken: {
version: 1,
operation: "token-request",
},
},
);
}Document: hasPrivateToken() method / notebook
Document: hasPrivateToken() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.