- send the
Authorization: Bearerheader on every request: in TypeScript and Python you set the header when you create the client, and in Rust the client attaches the credential you register, - type every request and response with the contract’s fields and names,
- retry reads and idempotent writes after transient errors such as
429and503, - report API errors with the problem details the API returns, and
- give you the status, headers, and request ID of a response when you need them.
Packages
The three packages share one version number and are released together. See
Versioning.
Install
Photon, and an asynchronous one, AsyncPhoton. The Rust
client is async and runs on Tokio; the Rust examples in this guide also use
#[tokio::main], which needs the Tokio features shown above.
Source and contract
The clients, the OpenAPI contract they are generated from (openapi/openapi.json),
and the changelog
are in photon-hq/api on GitHub. Report
bugs there as issues.
Every endpoint page in the API reference shows the call in
TypeScript, Python, and Rust.
Next steps
Credentials
Choose a credential and pass it to the client.
Making requests
Call an endpoint and read the response.
Errors
Handle API, transport, and response errors.
Retries and timeouts
Know what the clients retry and how to configure it.