Appearance
How-to: Handle Unsupported Requires
Use manifest requires as the load-time compatibility contract.
Steps
- Fetch the NIP-5A manifest.
- Parse required NAP names.
- Compare them with shell capability inventory.
- Reject loading or show a clear compatibility warning before treating the napplet as usable.
ts
const unsupported = manifest.requires.filter(
(name) => !bridgeSupports(name),
);
if (unsupported.length > 0) {
showCompatibilityWarning(unsupported);
return;
}Do not load a napplet and then silently fail required NAP calls. Optional features should use hosted supports() checks inside the napplet.