Use Node only for specific actions

As stated here (the screenshot) you can only opt into the node runtime by putting a directive on top of the file. This is not so great (for me at least) if this is the only option to use the node runtime because I only need node for a few (in my specific app one time) and want to group my functions into files by what they are doing.

Now that I have to put this node directive on top of the file I have to create to seperate files.

notifications-node.ts -> Single function that needs node js
notification-convex.ts -> Rest of the code

What I would like to see is that you can enable the runtime only for specific functions like that:

export const doSomething = action({
  "use node"
  handler: () => {
    // implementation goes here

    // optionally return a value
    return "success";
  },
});
image.png
Was this page helpful?