We primarily use this SDK in the Vercel Edge Runtime (on Next.js 14), which doesn't have support for the node:crypto module (only for the Web Crypto API). Commit 7580e133b111b6e212c3f89e43b7ce2b3dc78116 (in release 0.25.0 and onwards) added usage of createHmac for webhook payload signing, which causes builds to fail when the Increase SDK is imported on edge endpoints:
build: Failed to compile.
build:
build: ../../node_modules/increase/resources/webhooks.mjs:3:0
build: Module not found: Can't resolve 'crypto'
build:
build: https://nextjs.org/docs/messages/module-not-found
The Web Crypto API should likely be used directly for HMAC signing as a fallback in runtimes where crypto is unavailable.
We primarily use this SDK in the Vercel Edge Runtime (on Next.js 14), which doesn't have support for the
node:crypto
module (only for the Web Crypto API). Commit 7580e133b111b6e212c3f89e43b7ce2b3dc78116 (in release 0.25.0 and onwards) added usage ofcreateHmac
for webhook payload signing, which causes builds to fail when the Increase SDK is imported on edge endpoints:The Web Crypto API should likely be used directly for HMAC signing as a fallback in runtimes where
crypto
is unavailable.