app.rocksky.* XRPC endpoints behind a typed,
namespaced client.
Install
Quick start
Authentication
Read-only queries work without credentials. Mutating procedures need a JWT:Configuration
NewClient takes functional options:
| Option | Purpose |
|---|---|
WithBaseURL | Override the API host (self-hosted instance, httptest). |
WithBearerToken | Authenticate as a Rocksky user. |
WithHTTPClient | Inject a custom *http.Client (tracing, retries). |
WithUserAgent | Override the User-Agent header. |
WithHeader | Add an extra header to every request. |
https://api.rocksky.app. Default timeout: 30s.
Surface
context.Context plus a typed params/input struct.
Zero-valued option fields are omitted from the outgoing query string.
Pagination
Offset-based endpoints acceptPaginationParams{Limit, Offset}. Cursor-based
feed endpoints accept CursorPagination{Limit, Cursor} and return a Cursor
field to feed back into the next call.
Fluent builders
.Do(ctx) for queries and .Send(ctx) for procedures.
Errors
*rocksky.Error carries the HTTP status, XRPC error kind/message, and helpers
like IsUnauthorized, IsNotFound, IsRateLimited.
Types
Public model types are derived from the Rocksky lexicons and live inrocksky/gen (package gen). The package-level type aliases in rocksky/types.go re-export them under their historical names. Regenerate with bun run lexgen:types at the repo root.
License
MIT © Tsiry Sandratraina. Source:sdk/go.