Skip to main content
@jedify/sdk is the TypeScript SDK that calls semantic functions from a running app. Your agent writes this code for you — you don’t need to. This page is here so you can review what your agent generates, and so a developer on your team has a reference. (The MCP tools are for building; the SDK is what the finished app uses at runtime.)
Not a developer? You don’t need to read the code below. When you review what your agent built, just check three things: it calls each function by name, it wires every filter control to a parameter, and it shows sensible “loading” and “no data” states. If a number or chart looks wrong, tell your agent — you don’t have to fix it yourself.

What your agent sets up

npm install @jedify/sdk
import { Jedify } from '@jedify/sdk';

const jedify = new Jedify({
  apiKey: process.env.JEDIFY_API_KEY,   // required
  baseUrl: process.env.JEDIFY_BASE_URL, // your environment's URL
});

// Call a function by name — returns the rows directly
const data = await jedify.call('_COMPLETION_BY_DEPARTMENT', {
  department: 'R&D',
  start_date: '2026-01-01',
  end_date: '2026-06-30',
});
Use the exact column names from the function’s schema. Returned field names follow how the function’s query is written — they’re often uppercase (e.g. TOTAL_REVENUE) but not always, and some can contain spaces. Have your agent read the schema (or one returned row) and match the names exactly. Some numeric values may arrive as text, so the generated code should coerce numbers where it does math.

Configuration

new Jedify(config) accepts:
OptionTypeRequiredDefaultDescription
apiKeystringYesYour Jedify API key
baseUrlstringNohttps://api.jedify.comAPI base URL for your environment
timeoutnumberNo30000Request timeout (ms)
maxRetriesnumberNo3Retry attempts for 5xx errors
headersobjectNoCustom headers on every request
debugbooleanNofalseVerbose logging
Get an API key from app.jedify.com/settings/api-keys, and use the base URL for the environment your key belongs to.

Methods

listFunctions(filters?)

List the available functions.
const { functions } = await jedify.listFunctions({ search: 'revenue' });

getSchema(functionName)

Get one function’s parameters, output columns, and example usage.
const schema = await jedify.getSchema('_REVENUE_BY_REGION');

call(functionName, parameters?, options?)

Run a function. Returns the rows directly and throws on error.
const data = await jedify.call('_REVENUE_BY_REGION', { region: 'US', start_date: '2026-01-01', end_date: '2026-06-30' });
Options: fetchAll (auto-page through everything), page / limit (manual paging), timeout, signal (cancel).
const allData = await jedify.call('_LARGE_DATASET', {}, { fetchAll: true });

Error handling

call() throws typed errors the generated code can catch:
import { JedifyExecutionError } from '@jedify/sdk';

try {
  const data = await jedify.call('_REVENUE', params);
} catch (error) {
  if (error instanceof JedifyExecutionError) {
    console.error('Execution failed:', error.message, error.sqlExecuted);
  }
}
ClassMeaning
JedifyExecutionErrorThe query failed to execute
JedifyValidationErrorInvalid parameters
JedifyHttpErrorHTTP error (401, 404, …)
JedifyTimeoutErrorRequest timed out
JedifyNetworkErrorNetwork failure

TypeScript

Rows can be typed — match the field names to the function’s output schema:
interface RevenueRow { REGION: string; TOTAL_REVENUE: number; }
const data = await jedify.call<RevenueRow>('_REVENUE_BY_REGION', {});