PromptVault Docs
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

ToolVersionWhy
Node.js>= 18Required by the SDK.
npmbundled with NodeUsed for the example project.
PromptVault API keypv_live_... or pv_test_...Lets your application read prompts.

1. Create your first prompt

In the dashboard:

  1. Open Prompts.
  2. Click New prompt.
  3. Choose a slug such as support-triage.
  4. Write the prompt body.
  5. Save it to Live.

The first saved version is labelled v1.

2. Create an API key

  1. Open Settings -> API keys.
  2. Click Create key.
  3. Give it a name such as local-dev.
  4. Choose pv_live_ for live prompts or pv_test_ for staging reads.
  5. 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/sdk

4. 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

On this page