.repost schema into a typed Python package: keyword-only dataclasses, string enums, a webhooks.<type>.<member>() method tree, and descriptors used by the runtime. The repost-client runtime handles validation, serialization, HTTP, retries, idempotency, cancellation, and delivery outcomes. Python 3.10 or later is required.
The client is for trusted server-side code. It holds a publish credential, so do not ship it in desktop, mobile, browser, or other untrusted applications.
1
Install the CLI and runtime
Install the CLI and runtime:
2
Define the schema
repost schema init --language python --output ./repost_sdk creates a repost/ workspace, a .env file for your key, and this starter schema:repost/schema.repost
output. The path is relative to repost/schema.repost, and its final directory name becomes the importable package name—repost_sdk here.3
Record the schema and generate
4
Connect an environment
Create an environment in the dashboard, copy its publish API key into Load
.env, then sign in and deploy the migration:.env through your framework or process manager. The runtime reads REPOST_SEND_API_KEY, then REPOST_TOKEN.Your first send
customer_id identifies the customer receiving the event. Generated methods and models catch unknown members, missing fields, and incompatible values in your editor and type checker. The runtime validates and serializes the model again before opening a connection.
The idempotency key is optional. When you omit it, the runtime generates one key and reuses it across that operation’s attempts. Pass a business-stable key when your queue or process may repeat the logical send. Reliability explains how to handle ambiguous outcomes.
Create one client for a process or application container and close it during shutdown. A context manager is convenient for scripts and jobs; long-running applications should use their framework lifecycle. A complete generated example lives under examples/python in the repository.
Continue
Code generation
Generated package contents, regeneration, output ownership, and version checks.
Configuration
Credentials, deadlines, capacity, proxy, TLS, DNS, and HTTP/2.
Reliability
Idempotency, delivery states, cancellation, retries, and backpressure.