JavaScript Document hasRedemptionRecord() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Method

Definition

document.hasRedemptionRecord(issuer) returns a Promise that fulfills with a boolean: whether the browser has a redemption record originating from that issuer (MDN).

Pass the required arguments shown below. Check return values and browser support before you rely on the result.

Syntax

Call document.hasRedemptionRecord. Start with this line.

JavaScript
document.hasRedemptionRecord(issuer)
CallWhat it does
document.hasRedemptionRecord(issuer)Primary signature.
document.hasRedemptionRecord(...)Call with the arguments your case needs.

Built into the browser. Call hasRedemptionRecord(...) on document — no import required.

Library declarations
JavaScript
document.hasRedemptionRecord(issuer)

Parameters

ParameterDescription
issuerRequired. URL of the issuer server (MDN)
Secure contextRequired. Required; else NotAllowedError

Return Value

Return ValueDescription
*Promise that resolves to boolean

JavaScript Examples

Example 1 — Feature-Detect First

Experimental APIs must be detected before you call them.

JavaScript
const supported = typeof document.hasRedemptionRecord === "function";
console.log(supported);
console.log(supported ? "available" : "not supported");
Try It Yourself

How It Works

  1. Ask the engine. typeof … === "function" is the safe gate.
  2. Branch. Unsupported browsers skip the call entirely.
  3. Why it matters. MDN marks this API Experimental with limited support.
  4. Output varies. Chromium may print true; Firefox/Safari usually false.

Example 2 — Await the Boolean

MDN-style check: resolve whether a redemption record from that issuer exists.

JavaScript
async function checkIssuer() {
  if (typeof document.hasRedemptionRecord !== "function") {
    return "unsupported";
  }
  const hasRR = await document.hasRedemptionRecord("https://issuer.example");
  return hasRR ? "has redemption record" : "no redemption record";
}

checkIssuer().then(console.log);
Try It Yourself

How It Works

  1. Detect first. Return early when the method is missing.
  2. Pass an issuer URL. MDN: string URL of the issuer server.
  3. Await the Promise. Resolves to a boolean (MDN).
  4. Branch on the result. true → MDN may send the redemption record next.

Example 3 — Catch Invalid Issuer URLs

MDN: a non-URL issuer rejects with TypeError.

JavaScript
async function badIssuer() {
  if (typeof document.hasRedemptionRecord !== "function") {
    return "unsupported";
  }
  try {
    await document.hasRedemptionRecord("not-a-valid-url");
    return "ok";
  } catch (err) {
    return err.name; // often "TypeError"
  }
}

badIssuer().then(console.log);
Try It Yourself

How It Works

  1. Detect first. Unsupported engines never throw from this call.
  2. Pass a bad string. Not a valid URL → rejection (MDN TypeError).
  3. Catch the error. Read err.name for a clear student-friendly log.
  4. Other failures. Also watch for NotAllowedError / InvalidStateError (MDN).

Limited / Experimental Browser Support

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.

Limited Not Baseline
Google Chrome 117+
Yes
Microsoft Edge 117+
Yes
Opera 103+
Yes
Mozilla Firefox Not supported
No
Apple Safari Not supported
No
Internet Explorer Not supported
No
hasRedemptionRecord() Partial

Bottom line: Use only with feature detection and a fallback. See the MDN Document.hasRedemptionRecord() reference.

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.
Feature-detect with typeof document.hasRedemptionRecord === "function", use HTTPS (secure context), pass a valid issuer URL, and await the Promise (or use .then).

Next: hasStorageAccess()

Learn how document.hasStorageAccess() checks for storage access permission.

hasStorageAccess() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful