Skip to main content
@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

This connects to a server with authentication disabled; see Authentication for a deployed server. Request timeouts are set with 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 with filament.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:
A token minted elsewhere still works as 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 as sample or stdout. A connection is a configured instance you create using that connector. The workflow is:
  1. Create source and sink connections.
  2. Discover the source’s resources and select which ones to include.
  3. Create a pipeline and save its graph.
  4. Submit a run.
This example routes five rows from each selected sample resource to stdout. It requires a running Filament deployment with a working execution backend.
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:
Pass 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

Timeouts throw FilamentTimeoutError. The client retries failed requests twice by default; pass maxRetries: 0 on calls that must not repeat, since mutations are not generally idempotent.