Getting Started

Installation Guide

Set up your environment and install the Datafuse unified SDKs for Python and TypeScript.

Connecting your application to the Datafuse Active Integration network requires installing our lightweight client SDK. Datafuse provides first-class support for both Node.js/TypeScript and Python environments.


Prerequisites

Before installing the SDK, ensure you have:

  • A Datafuse developer account.
  • An active API Key (e.g. df_live_... or df_test_...), which you can fetch from your developer dashboard.
  • Node.js (version 18 or higher) or Python (version 3.8 or higher) installed in your workspace.

1. Python SDK Installation

For Python-based AI agent setups (supporting LangChain, LlamaIndex, CrewAI, AutoGen, and custom LLM loops), install our unified SDK via pip, poetry, or uv.

Core Package

bash
pip install datafuse-sdk

From Local Source (For Developers)

If you are developing locally inside the Datafuse monorepo and want to link the development SDK directly:

bash
pip install -e sdks/python

Quick Verification

Verify that the Python client can be imported without errors:

bash
python -c "import datafuse; print('Python SDK successfully installed!')"

2. TypeScript SDK Installation

!IMPORTANT@datafuse/sdk is not yet published to npm. Until it is, install it directly from the repository source shown below. If you only need Node/serverless calls today, the TypeScript client guide shows the equivalent fetch-based calls with zero dependencies.

From Source (Current Method)

Clone the monorepo (or copy the sdks/typescript directory), build it, and install it as a local file dependency:

bash
git clone https://github.com/ApertaCodex/datafuse.git
cd datafuse/sdks/typescript
npm install
npm run build

Then reference it from your project with a local file: dependency:

bash
npm install /absolute/path/to/datafuse.xyz/sdks/typescript

Quick Verification

Check that the built package resolves and exports the client correctly:

bash
node -e "const { Datafuse } = require('@datafuse/sdk'); console.log('TypeScript SDK successfully installed!');"

Environment Configuration

Datafuse clients automatically look for standard environment variables to initialize credentials, keeping your secrets out of source control.

Configure the following variables in your local .env file:

env
# API Key from your Datafuse developer console (df_live_... or df_test_...).
# Used ONLY for the /api/v1/connected_accounts routes. NOT accepted by the
# integration resolve-tools/invoke routes or most other authenticated routes
# (those require DF_TOKEN, the JWT bearer).
DATAFUSE_API_KEY=df_live_your_secret_key_here

# User access token (JWT) from the app's authentication flow.
# Required for integration, resolve-tools, invoke, and most authenticated routes.
DF_TOKEN=your_user_access_token

# Base API Server Endpoint (defaults to https://api.datafuse.xyz)
DATAFUSE_API_URL=https://api.datafuse.xyz

!IMPORTANT The integration routes (POST /api/v1/integrations, …/resolve-tools, …/invoke) currently accept a JWT bearer token (DF_TOKEN) only — they do not accept DATAFUSE_API_KEY. Use DATAFUSE_API_KEY only for the /api/v1/connected_accounts routes; every other authenticated route (including /api/v1/api-keys and /api/v1/audit/logs) requires a JWT bearer token. The curl and client guides below use DF_TOKEN for the integration flow.

!TIP If you are running Datafuse inside a private self-hosted VPC, change DATAFUSE_API_URL to point to your secure internal load balancer (e.g. http://datafuse-gateway.internal).


Next Steps

Now that the SDK is successfully installed: