@galaxy-io/filament-ts is the generated TypeScript client for Filament’s API.
It ships as ES modules with type declarations, has no runtime dependencies, and
runs on Node 18 or newer or any runtime with fetch.
Installation
Connect
timeoutInSeconds and retries with maxRetries, on the client or
per call.
Authentication
When the server runs with an identity provider, the SDK authenticates as a service account. Create one on the Members page of the web app, or withfilament.serviceAccount.create(...) while signed in as an admin. Both return a
client id and a client secret; the secret is shown once.
Pass them to the client. It mints an access token through the server and mints
again as the token nears expiry, so nothing about the identity provider reaches
your code:
token. For a local server with
authentication disabled, pass auth: false instead; the client refuses to
construct without one of the three.
Create and run a pipeline
A connector is an available integration, such assample or stdout. A
connection is a configured instance you create using that connector. The
workflow is:
- Create source and sink connections.
- Discover the source’s resources and select which ones to include.
- Create a pipeline and save its graph.
- Submit a run.
pipeline.create(...) creates the pipeline’s metadata and
pipeline.version.create(...) saves its graph; the backend assigns the version.
Both steps are required before the first run.
The sample source discovers users and orders. To route every resource
without enumerating them, save one edge with resource omitted.
Submitting a run returns its id and initial status without waiting for
completion. Inspect a run with filament.run.get({ runId }), or open the
pipeline in the web app. The stdout sink writes rows to the worker’s logs.
API groups
The SDK covers unary API methods. Streaming
TailRun is not included.
Responses and pagination
Methods resolve to typed responses.pipeline.create(...) resolves to an object
whose pipeline property holds the created pipeline. Request and response types
are exported under the Filament namespace.
Fields omitted by the server are undefined, including lists, so iterate with
response.pipelines ?? []. Protobuf 64-bit integer fields, such as timestamps and
record counts, can be decimal strings; use Number(value) or BigInt(value) when
needed.
List methods paginate explicitly:
nextCursor as pagination: { cursor: nextCursor, pageSize: 25 } to fetch
the next page while a cursor is present. Omitting pagination returns the full
result set.
Errors and retries
FilamentTimeoutError. The client retries failed requests twice
by default; pass maxRetries: 0 on calls that must not repeat, since mutations
are not generally idempotent.