Docs/SDK

Install

Install the Datayield SDK on a machine that can reach your systems, store your API key and create the pseudonym salt.

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:

bash
curl -fsSL https://bun.sh/install | bash

Once the @datayield/sdk package is published, run it with bunx:

bash
bunx @datayield/sdk --help

Until then, run it from the sdk folder of the Datayield repository:

bash
cd sdk && bun install
alias datayield="bun $PWD/src/cli.ts"
datayield --version

The 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:

bash
datayield init

init 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.json in 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:

bash
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.