API keys and tokens

Eagle 3D Streaming has two kinds of key, one kind of token, and a version-control switch. They live in the Developer section of the Control Panel.

CONTROL PANEL SIDEBAR Streaming Apps Multiplayer Server Apps Plans Analytics Utilities Additional Uploads Team Developer Section Documentation Logout Developer Section: account owner only Developer Section four tabs, in this order API Key Your account key. Server only. A new one cancels the old. Token Generation Single-use tokens, each good for one session. Streaming API Key The key a Web SDK integration uses to make tokens. Version Control Keep old builds when you upload, or replace them.
Where everything on this page lives. Team members do not see Developer Section at all; only the account owner does.

The two keys are not interchangeable

API keyStreaming API key
Can delete or replace your appYesNo
Use in a web integrationNo — being withdrawnYes
Keep itServer-side onlyServer-side, and never longer than you must

If you have an existing integration using the plain API key, move it to the Streaming API key now rather than when support ends. The change is one value, and the current arrangement means a key with the power to delete your application is being handed to every visitor's browser.

Which key goes where

The two keys look the same. Both are long strings of about 170–190 characters that start with U2Fs, so you cannot tell them apart by looking. Always copy the key from the tab named below, with that tab's Copy button.

Where the key goesThe key it needsCopy it from
Stream Agent on your own machine — "apiKey" in agent.config.jsonAPI keyDeveloper Section → API Key tab
Your scripts and servers calling our API (apikey header or apiKey field), automated uploads, the API Reference tabAPI keyDeveloper Section → API Key tab
Web SDK — sdk-config.js, or your server's token request (Authorization: Auth <key>)Streaming API keyDeveloper Section → Streaming API Key tab
A streaming link or an iframeNeither— the link itself starts the session

Developer Section is in the Control Panel sidebar and is shown to the account owner only. A team member who needs a key asks the owner for it.

How the Stream Agent checks its key

When the Stream Agent starts, it sends its key to our server. If the key is not accepted, the server works out what kind of mistake it is and tells the agent, and the agent window says so in plain words (shown below). The server names the key's type only when it is a working key of the other type; it never says whose key something is.

Agent starts and sends its key Is it the account's current API key? yes Accepted "Connected ... Ready to stream." no - what is it? Your current Streaming API key "This is your Streaming API key ... the Stream Agent needs your API key" The example text (PASTE_YOUR_API_KEY_HERE) "agent.config.json still holds the example text, not your API key" Anything else typo, cut short, old, not yours "Your API key was not accepted - it may be mistyped, cut short, old ..."
What the Stream Agent is told, in the order the server checks. Every message ends with a link to this section.

If you put one key in the other's place

You putInWhat you seeWhat to do
Streaming API keyStream Agent (agent.config.json) Agent window: This is your Streaming API key (it is for the Web SDK). The Stream Agent needs your API key instead ... Copy the key from the API Key tab, paste it as "apiKey" and save. The agent tries again by itself.
Nothing — the example text is still thereStream Agent agent.config.json still holds the example text, not your API key ... Replace PASTE_YOUR_API_KEY_HERE with your API key and save. The agent tries again by itself.
An API key that is mistyped, cut short, an old one (a newer key was generated since), or a key from another accountStream Agent Your API key was not accepted - it may be mistyped, cut short, or replaced by a newer key ... Copy the key again from the API Key tab with the Copy button. Keep the quotes around it in the file.
Streaming API keyYour script or server calling our API HTTP 401 "Critical Error In API Key" — the same answer as an old API key Use the key from the API Key tab.
API keyWeb SDK (sdk-config.js or the token request) It still works today — this is the old way, and support for it is being withdrawn Switch to the Streaming API key now. The API key can delete your app and must never reach a browser.
Any keyA streaming link or iframe Nothing — it is not used Nothing to do; the link alone starts the session.

Is the Stream Agent connected? The agent window says Connected to Eagle 3D Streaming as <machine name>. Ready to stream., and the machine appears in the Control Panel sidebar under Your machines, in the list Your stream agents — and in Utilities → Running Streaming Sessions with the filter My machines, as Idle (no viewer). After you generate a new API key, the agent's old key stops working at once: paste the new one into agent.config.json and save; the agent tries it by itself.

The API key

One per account, found in the Developer section.

Tokens

A token authorises one streaming session. Single use, and it expires if it is not used within the time you set.

That is what makes tokens the right thing to give a browser: one expires harmlessly, where a leaked key does not. Generate them from the Token Generation tab, or from your server as part of an SDK integration.

Because a token is single use, restarting a stream needs a fresh one — reusing the previous token fails rather than reconnecting.

The Streaming API key, and the tokens it makes

Both keys live here in the Developer section, but only one of them is used to stream. The Streaming API key exists to produce session tokens, and session tokens are a Web SDK concern — an iframe integration and a plain streaming URL use neither. If you are embedding with an iframe or sharing a link, you do not need this half at all.

Version control

A switch, and the two behaviours are quite different.

Version controlUploading a new build
On Adds a version. Version 3 becomes version 4, and 3 remains.
Off Replaces what was there. The previous build is gone.
Turn it on before you need it

With it off there is nothing to roll back to — the previous build was overwritten, not archived. The moment you discover you want the old version is the moment it is too late to have kept it.

Nothing runs until you press Send. Every call opens closed; opening one only shows it. Your key is filled in for you and shown masked (its first and last four characters). The curl line you can copy has YOUR_API_KEY in its place, so a copied example never carries your key.

Press Send Does the call change your account? no Sent at once, answer shown yes Asks first: "This changes your account" Yes, send it = sent. Cancel = nothing sent.
What Send does. The calls that change your account are marked changes data and their button is red.
Kind of callExamplesWhen you press Send
Reads onlyList your builds, Storage used, Sessions in a date range, Health checkSent at once. The answer, its HTTP code and the time it took are shown under the button.
Changes your accountDelete one version, Delete a build, Start an upload, Start the stream testA window asks first. Deleting cannot be undone.
Needs no keyWhere uploads goSent at once, without your key.
A field is missing or not validAn empty required field, a list that is not JSONThe button stays off and says which field.

Watch it in 1:09

API keys and tokens - which key goes whereVideo · 1:09

Related

Last updated