Obtain the required tokens for setup
To set up the Code Agent wtih the Broker client, you must have the following tokens:
Snyk API token - this token is required for the Code Agent setup. It is used in the
-e SNYK_TOKEN
parameter to authenticate the Code Agent component with your Snyk Account. See Obtain and use your Snyk API token and Set up the Code Agent.Broker token - this token is required for the Broker client setup. It is used in the
-e BROKER_TOKEN
parameter. The Broker token is associated with a specific Organization by default and with a specific integrated SCM, and enables Snyk Broker deployment for this Organization and SCM. For each SCM, a different Broker token is required. Details are on this page.Integrated SCM token - this token is required for the Broker Client setup. It is used in the
-e <SCM>_TOKEN
parameter, for example,-e GITHUB_TOKEN=xxx…
, to enable access to the SCM with certain permissions needed for the operation of the Broker and Snyk Code. For details, see Integrated SCM tokens for Snyk Broker.
After you have obtained the required tokens, save them in a safe and accessible place for use in setting up the Code Agent and the Broker Client.
Obtain your Broker token for Snyk Broker - Code Agent
You have the following options for obtaining the Broker token:
Using an existing Broker token for the Code Agent setup -If you already have a Broker token, which you used for running the Broker client for another Snyk product in the same Organization and the same SCM, you can also use it to set up Snyk Broker - Code Agent.
Using the same Broker token for multiple Snyk Organizations - Although by default a Broker token is associated with only one Snyk Organization, if you have Organization Admin permissions, you can use the same Broker token for multiple Organizations as follows:
A new Organization - If you create a new Organization based on an existing Organization that has a Broker token, the existing Broker token is cloned during the creation of the new Organization, and you can use it for the new Organization as well.
An existing Organization - If you want to use an existing Broker token for other existing Organizations, you can use the endpoint Clone an integration (with settings and credentials). This API clones existing integration settings, including the Broker token for the Integration.
Using a Broker token for redundancy -If you set up two Broker Clients for the same Organization and the same SCM for redundancy purposes, you must use the same Broker token for both Broker clients. You can obtain the Snyk Broker token in the following ways:
Recommended: ask your Snyk account team to generate a Broker token for you and then obtain it from the Web UI.
Generate the Broker token using Snyk APIs. See the instructions in the next section.
After a Broker token is generated by your Snyk account team or through the API, you can obtain your Broker token from the Web UI.
Generate your Broker token using the Snyk API
You can generate the Broker token by using the API as follows:
Use the endpoint Update Existing Integration to enable Snyk Broker for a specific Organization and a specific SCM. This generates a Broker token in the UI.
To generate a Broker token programmatically after enabling Snyk Broker, use the endpoint Provision new Broker token to generate a Broker token. You can see the generated Broker token in the API response body and on the Web UI.
After generating the Broker token, copy and save it and store it in a secure location for future use, or obtain it later using the Web UI.
Obtain your Broker token from the Web UI
After your Broker token is generated, it is displayed on the Web UI. Follow these steps to obtain the token:
In the Snyk Web UI, select the Organization for which you want to set up the Snyk Broker.
In the selected Organization, select Integration. Find the Integration to which you want to connect Snyk Broker, and click the Settings icon.
On the Settings page of the selected Integration, in the Broker Credentials section, copy the Broker token from the Token box and save it for future use:

Last updated
Was this helpful?