API Reference

@dompurify/server

It's also very simple to use and get started with. DOMPurify was started in February 2014 and, meanwhile, has reached version v3.4.16.

Official Documentation ↗
CompatibilityThis documentation covers version v3.0. Check the official docs for the latest API surface.

Installation

npmnpm install isomorphic-dompurify
pnpmpnpm add isomorphic-dompurify
yarnyarn add isomorphic-dompurify

Methods

Overview

It’s also very simple to use and get started with. DOMPurify was started in February 2014 and, meanwhile, has reached version v3.4.16.

API reference status

This page lists only entry points that appear verbatim in the official README examples: sanitize, match. Parameter and return types are not given by the official README, so signatures are marked unverified.

Errors

The following points are quoted verbatim from the official documentation (https://github.com/cure53/DOMPurify). Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.

  • Okay, makes sense, let’s move on After sanitizing your markup, you can also have a look at the property DOMPurify.removed and find out, what elements and attributes were thrown out. (https://github.com/cure53/DOMPurify)
  • That is circular by definition - sanitizing would call the policy, which sanitizes by calling DOMPurify again - and DOMPurify will throw a descriptive TypeError to prevent the infinite recursion. (https://github.com/cure53/DOMPurify)
  • If it is, DOMPurify strips the root’s subtree of every non-allow-listed attribute and then throws a TypeError, so a rejected root is never handed back armed. (https://github.com/cure53/DOMPurify)

Security notes

Quoted from the official documentation (https://github.com/cure53/DOMPurify); this is not a complete threat model.

Verification notes

FAQ

What does isomorphic-dompurify do?
It's also very simple to use and get started with.
How do I install isomorphic-dompurify?
Run `npm install isomorphic-dompurify`.
Where can I verify the API details?
Official repository/documentation: https://github.com/cure53/DOMPurify. Checked on 2026-11-04; signatures and return values not stated in the official README are marked unverified.