stefanoS
Convex Community2y ago
1 reply
stefano

"use node" in tutorial

https://docs.convex.dev/tutorial/actions

"use node";
import OpenAI from "openai";

// Initialize the OpenAI client with the given API key
const apiKey = process.env.OPENAI_API_KEY!;
const openai = new OpenAI({ apiKey });`


is there a particular reason why you guys used "use node" in this example?
I read the attached links about Convex runtime but also understood that the OpenAI package can be run in the default Convex Runtime, so wouldn't it better not to write "use node"?
Was this page helpful?