Skip to content

feat: use webcrypto API to support edge runtimes#384

Merged
roncohen merged 5 commits intomainfrom
node-sdk-use-web-crypto
Mar 25, 2025
Merged

feat: use webcrypto API to support edge runtimes#384
roncohen merged 5 commits intomainfrom
node-sdk-use-web-crypto

Conversation

@roncohen
Copy link
Contributor

Since digest is async, we need to update the interface to be async.

@roncohen
Copy link
Contributor Author

roncohen commented Mar 24, 2025

since this changes flag evaluation to async, the Node SDK need to be updated separately to also use async when calling getFeatures which requires a new major version :/

@roncohen roncohen requested a review from matus-vacula March 24, 2025 14:49
@roncohen roncohen enabled auto-merge March 24, 2025 14:54
@matus-vacula
Copy link
Contributor

Is the purpose of this to support the local evaluation in react and browser SDK? If we want to avoid the need for breaking the backwards compatibility for NodeSDK we can have 2 different implementations (sync and async) theoretically.

@roncohen
Copy link
Contributor Author

apologies, i did not write a good enough PR description.

To make the NodeSDK work in edge runtimes, like Vercel's or Cloudflare's we can't use node:crypto. They do implement the "Webcrypto" API though.

Copy link
Contributor

@matus-vacula matus-vacula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, that's what you meant by edge runtimes. I didn't know they use they different runtimes.

@roncohen roncohen added this pull request to the merge queue Mar 25, 2025
Merged via the queue into main with commit 6302392 Mar 25, 2025
5 checks passed
@roncohen roncohen deleted the node-sdk-use-web-crypto branch March 25, 2025 18:56
@roncohen roncohen restored the node-sdk-use-web-crypto branch March 28, 2025 14:22
@roncohen roncohen deleted the node-sdk-use-web-crypto branch March 28, 2025 14:22
roncohen added a commit that referenced this pull request Mar 28, 2025
github-merge-queue bot pushed a commit that referenced this pull request Mar 28, 2025
In #384 I made the interface async, that is no longer needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants