Installation Guide
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_...ordf_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
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:
pip install -e sdks/python
Quick Verification
Verify that the Python client can be imported without errors:
python -c "import datafuse; print('Python SDK successfully installed!')"
2. TypeScript SDK Installation
!IMPORTANT
@datafuse/sdkis 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 equivalentfetch-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:
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:
npm install /absolute/path/to/datafuse.xyz/sdks/typescript
Quick Verification
Check that the built package resolves and exports the client correctly:
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:
# 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 acceptDATAFUSE_API_KEY. UseDATAFUSE_API_KEYonly for the/api/v1/connected_accountsroutes; every other authenticated route (including/api/v1/api-keysand/api/v1/audit/logs) requires a JWT bearer token. The curl and client guides below useDF_TOKENfor the integration flow.
!TIP If you are running Datafuse inside a private self-hosted VPC, change
DATAFUSE_API_URLto point to your secure internal load balancer (e.g.http://datafuse-gateway.internal).
Next Steps
Now that the SDK is successfully installed:
- Follow the 5-Minute Quickstart to list integrations, resolve tools, and invoke a tool.
- Prefer the terminal? Use the 5-Minute Quickstart with curl.
- Explore our TypeScript client guide or Python client guide.