Skip to main content
Your app talks to Reintersect through a client typed by your app. It has only the methods your scopes allow, and its block methods accept only blocks your app includes.

Methods

Calling a method whose scope the piece didn’t declare is a type error that names the scope. Passing a block the app doesn’t include is a type error that names the block. circleId targets work only in circles that use chat; see Writing to circles. Search objects and memories have no client methods yet; call their endpoints with fetch.

Promise results

Promise methods resolve to { data, error } and never reject for modeled failures:
Cancellation and unexpected defects reject. The error union lists every tagged error the endpoint can return, plus transport and token failures.

Authentication

A client authenticates as one install, and the SDK never needs a long-lived token: createReintersectClient(app, options) options: When the SDK fails to get a token, it returns the API’s own error where one exists: ReintersectAppInstallNotFoundError (no such install for your app), ReintersectAppInstallRevokedError (uninstalled or suspended) and ReintersectApiRateLimitExceededError. Otherwise they are ReintersectAppInstallTokenError (reason: Rejected, Unreachable or InvalidResponse) or ReintersectAppConfigurationError (missing credentials).

Retries

The SDK retries reads (get, query, revalidate) twice with jittered backoff on network errors, timeouts and 503. Writes run once, so retry them yourself when it’s safe, for example with expectedVersion. Only streams.sendEvent takes an idempotencyKey, so a resent event posts once.

Effect client

Methods return Effects with the same errors in the error channel. Inside Effect handlers, the context’s reintersect is the Effect flavour. See Client and streams in the Effect guide.

renderPayload

renderPayload(content) renders JSX or a structured document into the exact JSON the API accepts, for any HTTP client or another language’s server:
It rejects files and images, because nothing uploads them. The Effect entry exports renderPayload returning an Effect.

The member API client

createReintersectClient({ apiKey }), with one argument, is the client for Reintersect’s member API. It acts as a member with an API key from Settings → Developer → API keys, for circles, conversations, replies and files. It’s separate from the app client, and the SDK’s README documents it. createReintersectStream posts to circle app stream URLs.