Skip to main content

Client SDKs

A Priompt SDK is the client library your app uses to fetch prompts from a Priompt server by address and to hear when they change. Priompt has SDKs for Python and Node, and any other language can call the same gRPC API directly.

How a client talks to the server​

Each client makes two connections. The diagram shows what goes over each one.

  • gRPC on port 8443 carries every request: fetch, list, diff, publish, and the versioning RPCs.
  • NATS on port 4222 carries change events to subscribers. Only subscribe() uses it.

Feature matrix​

The SDKs wrap the calls an app makes most. The gRPC API has every operation, and both SDK packages include the stubs or the .proto file to reach it.

FeaturePythonJavaScriptgRPC
Fetch the served versionget(uri)get(uri)GetPrompt
Pin a branch or commitget(uri, ref=...)get(uri, ref)GetPrompt with ref
List prompts under a prefixlist(prefix)NoListPrompts
Semantic diff of a draftdiff(uri, new_template)diff(uri, newTemplate)DiffPrompt
Publish to mainNopublish(uri, template, slots)PublishPrompt
Subscribe to changessubscribe(uri, on_change)subscribe(uri, onChange)Any NATS client
History, branches, merge, rollbackStubs in priompt_sdk.v1Stubs from the shipped .protoHistory, CreateBranch, MergeBranch, SetBranch
Local cachecache_ttl=NoNo
TLS and mTLSYesYesYes
Connection URL (PRIOMPT_URL)YesYesNo

"No" means the SDK doesn't wrap the call. You can still make it through the stubs.

Install a client​

pip install priompt-sdk

Requires Python 3.9 or later. See Python SDK.

Connection settings​

Both SDKs read the same connection URL from the PRIOMPT_URL environment variable:

export PRIOMPT_URL=priompt://<token>@prompts.example.com:8443

Replace <token> with a token the server accepts, or leave out <token>@ for a server without authentication. An explicit host or token passed in code wins over the URL. The broker for change events takes its own URL and its own token, because the broker credential is separate from the gRPC token.

Next steps​