Example 1 — Feature-Detect
Check whether the Ink API is available before calling it.
const supported = "ink" in navigator;
console.log(supported ? "Ink API available" : "Ink API missing"); How It Works
- Use
in."ink" in navigatorchecks for the property. - Expect limited support. Strongest historically in Chromium (Chrome, Edge, Opera).
- Treat as optional. Missing Ink must not break drawing.
- Keep a fallback. Pointer Events + canvas still do the real stroke.

