Getting Started
Quickstart
Go from a new PromptVault workspace to a Node script that reads a live prompt through the SDK.
This page gets you from a new PromptVault workspace to a Node script that reads a live prompt through the SDK.
Prerequisites
| Tool | Version | Why |
|---|---|---|
| Node.js | >= 18 | Required by the SDK. |
| npm | bundled with Node | Used for the example project. |
| PromptVault API key | pv_live_... or pv_test_... | Lets your application read prompts. |
1. Create your first prompt
In the dashboard:
- Open Prompts.
- Click New prompt.
- Choose a slug such as
support-triage. - Write the prompt body.
- Save it to Live.
The first saved version is labelled v1.
2. Create an API key
- Open Settings -> API keys.
- Click Create key.
- Give it a name such as
local-dev. - Choose
pv_live_for live prompts orpv_test_for staging reads. - Copy the key when it is shown.
Store the key in your application environment:
export PROMPTV_KEY="pv_live_..."3. Install the SDK
npm install @promptv/sdk4. Read a prompt from code
import { promptvault } from "@promptv/sdk";
const pv = promptvault({ key: process.env.PROMPTV_KEY! });
const prompt = await pv.get("support-triage");
console.log(prompt.version); // e.g. "v1"
// `pv.get()` returns a Prompt object, not a string. Send the chat-formatted
// messages straight to any provider:
await openai.chat.completions.create({
model: prompt.model,
messages: prompt.messages, // [{ role: "system", content }, { role: "user", content }]
});prompt.source (system + user joined by a blank line) is also available for legacy single-string callers. If you used a different slug, pass that slug to pv.get(...).
5. Add variables
If your prompt includes {{recipient_name}}, pass values at fetch time:
const prompt = await pv.get("onboarding-email", {
variables: { recipient_name: "Maya" },
});The SDK replaces both {{name}} and {name} tokens. See Variables.
Where to go next
- Dashboard tour - visual walkthrough of every screen.
- Concepts - workspaces, prompts, versions, environments.
- SDK reference - every method, option, and type.
- Integrations overview - connect prompt events to your existing tooling.