@prompty-tools/core

A typed, zero-dependency TypeScript client for the prompty.tools public HTTP API. Run every example on this site against your own account.

Quick start

Install the package, paste your API key into the bar above, and run the example below - it lists the most recent public prompts.

npm install @prompty-tools/core
Live example
// Walk the public feed.
const page = await client.prompts.list({ scope: "public", pageSize: 6 });
console.log(`Found ${page.total} public prompts.`);
return page.items.map((p) => ({ id: p.id, title: p.title, tags: p.tags }));

What's in the box

Six resource namespaces

Prompts, personas, tones, outputs, constraints, and collections - covering all 46 v1 endpoints.

Typed end-to-end

Hand-crafted DTOs mirror the server. Inputs, responses, list envelopes, and errors all carry full TypeScript types.

Pagination built-in

list() returns a navigable Page<T>; listAll() walks every page as an async iterator.

Typed errors

PromptyAuthError, PromptyNotFoundError, PromptyRateLimitError… narrow with instanceof.

Bring your own fetch

Inject a custom fetch for Cloudflare Workers, Deno, Bun, or request tracing.

Zero runtime deps

Pure native fetch, URL, AbortSignal. ~22 KB minified. Tree-shakable. Dual ESM + CJS publish.

Where to next

About the runnable examples Every code block on this site executes in your browser using @prompty-tools/core against the live API. Your API key is kept in localStorage only - it is never sent anywhere except www.prompty.tools.