@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
// 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
Five top-level resources
Prompts, personas, tones, outputs, and constraints. Tones and
constraints each expose a nested collections
sub-resource, mirroring the platform's URL hierarchy.
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
- Getting started - install, authenticate, make your first call.
- Concepts - pagination, error handling, hooks, retries, aborting, and bringing your own fetch.
- API reference for prompts, personas, tones (with tone collections), outputs, and constraints (with constraint collections).
@prompty-tools/core against the live API. Your API key is
kept in localStorage only - it is never sent anywhere
except www.prompty.tools.