Skip to main content

Farseer Client

TypeScript SDK for the Farseer Platform

farseer-client is a TypeScript SDK for interacting with the Farseer API. It provides type-safe access to all Farseer features including data import/export, dimension management, file operations, and more.

import { FarseerClient } from 'farseer-client';

const client = new FarseerClient();
const users = await client.users.list();

Key Features

FeatureDescription
Complete API Coverage37 API modules covering all Farseer endpoints
Type Safety469+ TypeScript models auto-generated from OpenAPI spec
High-Level AbstractionsSimplified methods for tags, imports, exports, files
Arquero IntegrationBuilt-in data transformation with Arquero tables
Multiple Auth MethodsEnvironment variables, constructor params, or custom config
External API SupportRESTApi class for consuming third-party APIs

Quick Example

import * as farseer from 'farseer-client';
import * as aq from 'arquero';

const client = new farseer.FarseerClient();
await client.initTagMap();

// Export dimension table data
const { table } = await client.data.loadFarseerDimensionTable('Products');
table.print();

// Import data
const importJob = await client.createImportJob({
title: 'Revenue Import',
columns: [
{ type: 'DIMENSION_TABLE', dimensionTableName: 'Products' },
{ type: 'VARIABLE', variableName: 'Revenue' },
],
labels: ['auto', 'revenue']
});

await importJob.addRows([['Product A', 100000], ['Product B', 200000]]);
await importJob.flushRows();
await importJob.commit();

Architecture

The SDK consists of three layers:

  1. Generated APIs (client.users, client.entities, client.evaluator, ...) - Auto-generated from the Farseer OpenAPI specification, providing direct access to all REST endpoints.

  2. High-Level Client (FarseerClient) - Wraps the generated APIs with convenience methods for common operations like tag management, folder navigation, import jobs, and formula evaluation.

  3. Data Module (client.data) - Provides Arquero-based data operations for loading dimension tables, exporting variables, and working with Excel/CSV files.