Deploy your Editor prompts effortlessly with a light and modern package.
Important Notice: As of April 25th, 2025, the @helicone/generate SDK has been discontinued. We launched a new prompts feature with improved composability and versioning on July 20th, 2025.The SDK and the legacy prompts feature will continue to function until August 20th, 2025.
Installation
npm install @helicone/generate
Usage
Simple usage with just a prompt ID
import { generate } from "@helicone/generate";// model, temperature, messages inferred from idconst response = await generate("prompt-id");console.log(response);
const promptId = "homework-helper";const chat = [];// Userchat.push("can you help me with my homework?");// Assistantchat.push(await generate({ promptId, chat }));console.log(chat[chat.length - 1]);// Userchat.push("thanks, the first question is what is 2+2?");// Assistantchat.push(await generate({ promptId, chat }));console.log(chat[chat.length - 1]);
Supported Providers and Required Environment Variables
Ensure all required environment variables are correctly defined in your .env
file before making a request.