@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
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
- 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, outputs, constraints, and 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.