Language Guide · TypeScript
Manage AI Prompts in TypeScript
No SDK required. One HTTP call.
Fetch versioned, variable-interpolated AI prompts from TypeScript or JavaScript using the native fetch() API. Zero new dependencies, works in Node.js, Deno, Bun, and edge runtimes.
Code Example
One function. Any AI provider.
Fetch a versioned, interpolated prompt from PromptForge with a single HTTP call. The returned content string passes directly to your AI SDK — no transformation, no adapter, no extra library.
- 1Fetch a versioned prompt by ID with your variable values.
- 2Receive the fully rendered content string in the response.
- 3Pass it directly to your AI provider SDK as the system prompt.
interface PromptResponse {
content: string;
version: number;
variables: string[];
}
const res = await fetch(
"https://www.promptforge-app.com/api/v1/prompts/YOUR_PROMPT_ID" +
"?_version=latest&role=developer&task=review+code",
{
headers: { Authorization: "Bearer YOUR_API_KEY" },
next: { revalidate: 60 }, // Next.js cache hint (optional)
},
);
const { content } = (await res.json()) as PromptResponse;
// Pass to any AI SDK
// const response = await openai.chat.completions.create({
// model: "gpt-4o",
// messages: [{ role: "system", content }],
// });Why TypeScript teams choose PromptForge
Designed for developers who want control without complexity.
Zero extra dependencies
Uses the native fetch() API built into Node 18+, Deno, Bun, and all edge runtimes. Nothing to install, nothing to bundle.
Typed response in one line
Cast the JSON response to a simple interface with a content: string field and you get full autocomplete and compile-time safety.
Edge and serverless ready
Works in Next.js Server Components, Vercel Edge Functions, Cloudflare Workers, and AWS Lambda — anywhere that supports fetch().
Integrate in 4 steps
From zero to fetching your first versioned prompt in under 10 minutes. No framework setup, no SDK installation — just HTTP.
- 1
Create a prompt with variables
Open the dashboard, click New Prompt, and write your system prompt using {{variable}} placeholders for any dynamic values.
- 2
Copy your prompt ID
Your prompt ID appears in the URL bar when editing: /dashboard/prompts/YOUR_PROMPT_ID. The API Usage panel also shows it with pre-filled examples.
- 3
Generate an API key
Go to the API settings page and click Generate Key. Store it in an environment variable such as PROMPTFORGE_API_KEY.
- 4
Fetch with the native fetch() API
One awaited fetch() call with an Authorization header. Optionally add a Next.js revalidate hint for smart caching. Pass the content string straight to your AI SDK.
Teams building AI features in TypeScript
Full-stack TypeScript teams use PromptForge to centralize the system prompts scattered across their Next.js apps, API routes, and background workers. Product managers can iterate on prompts without touching the codebase — and changes ship without a deployment.
Start Free TrialStart for free, upgrade anytime
No credit card required to get started. Paid plans include a 14-day free trial.
- 1 Production Prompt
- 1,000 API Requests/mo
- Stable/Latest Channel Routing
- No Credit Card Required
No charge until your trial ends
- 10k API requests/month
- 5 prompt
- Unlimited versions
- Dynamic variables
- Version pinning
- API key management
No charge until your trial ends
- 100k API requests/month
- 25 prompt
- Unlimited versions
- Dynamic variables
- Version pinning
- API key management
No charge until your trial ends
- 500k API requests/month
- 100 prompt
- Unlimited versions
- Dynamic variables
- Version pinning
- API key management
Questions? Contact us