Skip to main content
The @oleanderhq/sdk package provides a typed client for the oleander API. It covers lake queries, Spark job management, and run polling.

Installation

npm install @oleanderhq/sdk

Authentication

Create an API key in your oleander settings, or run oleander configure if you use the CLI. You can pass the key directly or set the OLEANDER_API_KEY environment variable.
import { Oleander } from "@oleanderhq/sdk";

// Option 1: pass the key directly
const client = new Oleander({ apiKey: "your-api-key" });

// Option 2: reads OLEANDER_API_KEY from the environment
const client = new Oleander();

Quick start

import { Oleander } from "@oleanderhq/sdk";

const client = new Oleander();

// Query the lake and iterate over results
const result = await client.query("SELECT * FROM public.iris_dataset LIMIT 10");
for (const row of result.results?.rows ?? []) {
  const [sepalLength, sepalWidth] = row as [number, number];
  // process each row ...
}

// List available Spark job scripts
const { scripts, hasMore } = await client.listSparkJobs();

// Submit a Spark job and wait for it to finish
const { runId, state, run } = await client.submitSparkJobAndWait({
  namespace: "my-namespace",
  name: "daily-etl",
  scriptName: "etl_pipeline.py",
});

if (state === "FAIL") {
  throw new Error(`Run ${runId} failed after ${run.duration}s`);
}

Constructor options

ParameterTypeDefaultDescription
apiKeystringOLEANDER_API_KEY env varYour oleander API key
baseUrlstringhttps://oleander.devAPI base URL. Override for local development.