allenA
Convex Community3y ago
19 replies
allen

Crypto dependency

It seems that the convex client has a dependency on the Crypto API (https://developer.mozilla.org/en-US/docs/Web/API/Crypto) which is not available in the React Native runtime.

I am encountering this when trying to optimistically insert a document into the local cache. Even if I don't lean on the
crypto
api directly like the documentation suggests (https://docs.convex.dev/client/react/optimistic-updates#complex-example) and provide a different random string, it still seems the convex client attempts to use this api.

Before I go hunting for a polyfill or shim, I was wondering if there is another approach I can take.
The Crypto interface represents basic cryptography features available in the current context.
It allows access to a cryptographically strong random number generator and to cryptographic primitives.
Crypto - Web APIs | MDN
Even though Convex queries are completely reactive, sometimes you'll want to
Was this page helpful?