The SDK is a command-line tool, datayield, from the @datayield/sdk package. It runs on Bun 1.2 or later, on macOS, Linux, or a CI runner such as GitHub Actions.
Where to run it
Run the SDK on a machine you control that can reach the systems you want to connect: a server in your network, an always-on workstation, or a CI job. Raw records are pulled and scrubbed on that machine, so pick one your security team is comfortable holding the data. The SDK needs outbound HTTPS to your source systems and to https://datayield.ai.
Install Bun and the SDK
Install Bun first:
curl -fsSL https://bun.sh/install | bashOnce the @datayield/sdk package is published, run it with bunx:
bunx @datayield/sdk --helpUntil then, run it from the sdk folder of the Datayield repository:
cd sdk && bun install
alias datayield="bun $PWD/src/cli.ts"
datayield --versionThe rest of these docs write the command as datayield.
Initialize
Create an API key in the portal under Settings → API keys, then run init in the folder where you want the config to live:
datayield initinit asks for the key, checks it against the API, and prints your organization's name and the key's mode. It then:
- writes
datayield.config.jsonin the current folder, keeping any sources already in it - stores the API key in
~/.datayield/credentials, a file only your user can read (mode 600) - creates the salt that keys every pseudonym, and stores it in the same file
To pass the key without a prompt, for example in a script:
datayield init --api-key "$DATAYIELD_API_KEY"| Flag | Meaning |
|---|---|
--api-key <key> |
The API key, instead of prompting |
--api-url <url> |
A different API base URL, saved in the config |
--skip-verify |
Do not check the key against the API |
Back up the salt
The salt in ~/.datayield/credentials decides every pseudonym. If it changes, every token changes, and buyers can no longer join new batches to old ones. Copy it somewhere safe, such as your password manager, and use the same salt on any other machine that runs the SDK for the same sources. It must never be sent to us or to a buyer.
Next
Add a source with datayield connect <connector>. See Connectors for the options each one needs, or follow the Quickstart.