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
| Feature | Description |
|---|---|
| Complete API Coverage | 37 API modules covering all Farseer endpoints |
| Type Safety | 469+ TypeScript models auto-generated from OpenAPI spec |
| High-Level Abstractions | Simplified methods for tags, imports, exports, files |
| Arquero Integration | Built-in data transformation with Arquero tables |
| Multiple Auth Methods | Environment variables, constructor params, or custom config |
| External API Support | RESTApi 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:
-
Generated APIs (
client.users,client.entities,client.evaluator, ...) - Auto-generated from the Farseer OpenAPI specification, providing direct access to all REST endpoints. -
High-Level Client (
FarseerClient) - Wraps the generated APIs with convenience methods for common operations like tag management, folder navigation, import jobs, and formula evaluation. -
Data Module (
client.data) - Provides Arquero-based data operations for loading dimension tables, exporting variables, and working with Excel/CSV files.