next.js
88a033fa - chore: expose `globalThis.crypto` when not available (#48941)

Commit
2 years ago
chore: expose `globalThis.crypto` when not available (#48941) ### What? Exposing `globalThis.crypto`, based on [Node.js' WebCrypto API](https://nodejs.org/api/globals.html#crypto_1) ### Why? Similar to `fetch`, `crypto` is a popular API that is currently not available on `globalThis` in all active Node.js versions yet. This can help library authors to create runtime-agnostic packages. ### How? Node.js already has the WebCrypto API that can be imported, we just expose it on `globalThis` in Node.js versions where this is not available. Closes NEXT-1063 [Slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1681821510191059)
Author
Parents
Loading