document.hasRedemptionRecord() is an instance method that asks whether the browser already has a redemption record from a given issuer (see MDN Document: hasRedemptionRecord()). Learn how it differs from hasPrivateToken(), secure-context rules, exceptions, and safe feature detection.
01
Kind
Instance method
02
Arg
issuer URL
03
Returns
Promise<boolean>
04
Context
Secure (HTTPS)
05
Checks
Redemption record
06
Status
Experimental
Fundamentals
Introduction
In the Private State Token flow, issuers can mint tokens and later sites can redeem them. After redemption, the browser may store a redemption record. This method answers: do we already have one from issuer X?
MDN: hasRedemptionRecord() returns a promise that fulfills with a boolean indicating whether the browser has a redemption record originating from a particular issuer.
💡
Think: token check vs redemption check
1) hasPrivateToken() — token stored? 2) hasRedemptionRecord() — redemption record stored? 3) If yes, you may send it with operation: "send-redemption-record" (MDN) 4) Always feature-detect first
🔒
Secure context required
MDN: NotAllowedError is thrown if the document is not loaded in a secure context. Use HTTPS (or localhost) when experimenting.
An instance method on the Document interface from the Private State Token API (MDN). Call it on document.
issuer — string URL of an issuer server (MDN).
Return value — a Promise that resolves to a boolean (MDN).
true — a redemption record from that issuer is stored.
false — no redemption record for that issuer yet.
Experimental — limited browser support; feature-detect first (MDN).
Companion API — often used after tokens exist; see hasPrivateToken().
Foundation
📝 Syntax
General form of Document.hasRedemptionRecord (MDN):
JavaScript
hasRedemptionRecord(issuer)
Parameters
issuer — a string representing the URL of an issuer server (MDN). Prefer a full absolute URL such as "https://issuer.example".
Return value
A Promise that resolves with a boolean value indicating whether the browser has a redemption record stored that originates from the specified issuer server (MDN).
Exceptions (MDN)
InvalidStateError — the current Document is not yet active.
NotAllowedError — the current Document is not loaded in a secure context.
Examples follow MDN Document: hasRedemptionRecord() with beginner-safe feature detection. Many demos will report “not supported” outside Chromium.
📚 Getting Started
Detect support before calling the experimental method.
Example 1 — Feature-detect safely
Always check that the function exists before awaiting it.
JavaScript
if (typeof document.hasRedemptionRecord === "function") {
console.log("hasRedemptionRecord is available");
} else {
console.log("hasRedemptionRecord is not supported in this browser");
}
Document.hasRedemptionRecord() is Experimental on MDN. Support is primarily Chromium-based (Chrome / Edge from 117+, Opera from 103+). Firefox and Safari currently lack support. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Experimental · Limited
Document.hasRedemptionRecord()
Promise-based check for a stored redemption record from an issuer URL. Feature-detect before use.
LimitedNot Baseline
Google Chrome117+
Yes
Microsoft Edge117+
Yes
Opera103+
Yes
Mozilla FirefoxNot supported
No
Apple SafariNot supported
No
Internet ExplorerNot supported
No
hasRedemptionRecord()Partial
Bottom line: Use only with feature detection and a fallback. Prefer learning this API for privacy experiments; do not assume universal browser support.
Wrap Up
Conclusion
document.hasRedemptionRecord(issuer) is an experimental instance method that resolves to whether a redemption record from that issuer is already stored. Feature-detect, stay on HTTPS, pass a valid issuer URL, and pair it with hasPrivateToken() when learning the full flow.
Send redemption records only when the boolean is true (MDN)
❌ Don’t
Ship without a fallback on unsupported browsers
Confuse this with hasPrivateToken()
Pass relative or invalid issuer strings
Assume Firefox/Safari support today
Treat this as a Baseline everyday DOM API
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about hasRedemptionRecord()
Experimental issuer redemption-record check.
5
Core concepts
📝01
Returns
Promise<bool>
MDN
🔄02
Arg
issuer URL
MDN
🎯03
Checks
redemption
record
⚡04
Detect
typeof check
first
🛡05
Status
Experimental
MDN
❓ Frequently Asked Questions
MDN: Document.hasRedemptionRecord() returns a promise that fulfills with a boolean indicating whether the browser has a redemption record originating from a particular issuer.
MDN marks Document.hasRedemptionRecord() as Experimental. It is not Deprecated or Non-standard, but support is limited — check compatibility before production use.
hasPrivateToken() asks whether a private state token from an issuer is stored. hasRedemptionRecord() asks whether a redemption record from that issuer already exists (after redeeming tokens).
MDN: issuer — a string representing the URL of an issuer server.
MDN: InvalidStateError if the Document is not yet active; NotAllowedError if not in a secure context; TypeError if issuer is not a valid URL.
It is an instance method on Document (MDN page type). Call it as document.hasRedemptionRecord(issuer), and feature-detect with typeof document.hasRedemptionRecord === "function".
Did you know?
MDN’s example only sends the redemption record when hasRedemptionRecord is true — the opposite pattern of hasPrivateToken, which often requests a token when the result is false.