punn
punn2y ago

How do I use a module built into node?

Seems like there's an error bundling the crypto module. Any ideas on how to resolve this error?
No description
6 Replies
Presley
Presley2y ago
Use an action https://docs.convex.dev/functions/actions and make it run in node - for convex 0.13.0 you to “use node”;. Prior to 0.13.0 you need to put it in /convex/actions folder.
Actions | Convex Developer Hub
Actions can call third party services to do things such as processing a payment
punn
punnOP2y ago
its just a helper function using the crypto module. is an action the only way?
Presley
Presley2y ago
Unfortunately, yes. We might add crypto in our js environment in the future.
punn
punnOP2y ago
I assumed actions are intended for uses that could induce side effects
Presley
Presley2y ago
Yeah, side effects is primary use case but they also as escape hatch to run in Node.js (or other permissive environments in the future)
punn
punnOP2y ago
got it thanks!

Did you find this page helpful?