Zero Hardcoded Prompts
Fetch prompts at runtime with getPrompt() and getPrompts(). Update wording, model, and temperature from the CMS - no code changes, no redeploys.
bun add @promptlycms/promptsnpm install @promptlycms/promptsyarn add @promptlycms/promptspnpm add @promptlycms/promptsZero Hardcoded Prompts
Fetch prompts at runtime with getPrompt() and getPrompts(). Update wording, model, and temperature from the CMS - no code changes, no redeploys.
AI SDK Integration
getPrompt() returns model, temperature, and messages ready for Vercel AI SDK functions like generateText() and streamText().
Multi-Model Auto-Detection
Supports all AI SDK providers. Automatically resolves models from your CMS config - no manual provider setup.
Codegen for Type Safety
Run npx promptly generate to generate typed template variables via declaration merging. Full autocomplete in your editor.
import { createPromptlyClient } from '@promptlycms/prompts';import { generateText } from 'ai';
const { getPrompt } = createPromptlyClient();
// fetch your prompt at runtime - no prompts harcoded in your codebaseconst { userMessage, systemMessage, temperature, model } = await getPrompt( 'upsellMessage',);
const { text } = await generateText({ model, messages: [ { role: 'system', content: systemMessage, }, { role: 'user', content: userMessage({ username, persuasionLevel: 1, recentPurchases, }), }, ], temperature,});
console.log(text);