A computer needs an API key to send data. You do not have to copy one: datayield login creates one for you after you approve it in the browser.
Sign in with your browser
datayield login- The terminal shows a short code, such as
BCDF-GHJK, and opens the portal. - Sign in to the portal if you are not already.
- Check that the code on the page matches the one in your terminal.
- If you belong to more than one organization, pick the one this computer sends data for.
- Click Approve.
The terminal then says which organization this computer sends data for. Datayield has created an API key named "CLI on" followed by your computer's name; you can see and revoke it in the portal under Settings → API keys.
Codes expire after 10 minutes and work once. If you click Deny, nothing is shared. If the browser does not open, copy the link from the terminal. On a server with no browser, run datayield login --no-browser and open the link on your phone or laptop.
| Flag | Meaning |
|---|---|
--org ID |
Preselect this organization on the approval page (its id, from the portal) |
--test |
Create a test key. Batches sent with it are never billable. |
--no-browser |
Only print the link |
Check who you are
datayield whoamiShows the organization this folder sends data for, the key's name and mode, and any other organizations this computer is signed in to.
Several organizations on one computer
If you work for more than one organization, sign in to each one. Each gets its own key, its own salt and its own stored tokens, kept apart in ~/.datayield/credentials.
Each folder's datayield.config.json records the organization it sends for, so give each organization its own folder. To change which organization a folder uses:
datayield switch # pick from a list
datayield switch "Kestrel Two" # or name itYou can also pick for one command with --profile <organization id or name>.
An upload stops before sending anything if the folder's organization is not the key's organization, and tells you to run datayield switch or datayield login --org <id>.
Without a browser
Create a key in the portal under Settings → API keys and paste it:
datayield init --api-key dy_live_...On CI, set the DATAYIELD_API_KEY environment variable instead. It takes precedence over the credentials file.