---
agentTools:
  projectIndex: https://docs.cancergenomicscloud.org/llms.txt
---

# Store credentials to access Seven Bridges client applications and libraries

\##Overview

Seven Bridges maintains client applications and libraries which require authentication. Instead of storing your credentials separately for each client application or client library, use a unified configuration file to securely maintain your credentials and authenticate. On this page, learn about [Seven Bridges client applications and libraries](#section-seven-bridges-client-applications-and-libraries) which require authentication, how applications and libraries [check for credentials](#section-hierarchy-of-credentials), and about [using a unified configuration file](#section-unified-configuration-file).

\##Seven Bridges client applications and libraries

The following Seven Bridges client applications and libraries require your Seven Bridges Platform credentials to authenticate.

[block:parameters]
{
  "data": {
    "h-0": "Application or library name",
    "h-1": "Description",
    "0-1": "sevenbridges-python is the official Seven Bridges -maintained Python bindings for the Seven Bridges API.",
    "1-1": "sevenbridges-r is the official Seven Bridges -maintained R bindings for the Seven Bridges API.",
    "0-0": "[sevenbridges-python](https://docs.cancergenomicscloud.org/docs/api-python-library)",
    "1-0": "[sevenbridges-r](https://docs.cancergenomicscloud.org/docs/api-r-library)"
  },
  "cols": 2,
  "rows": 2
}
[/block]

\##Hierarchy of credentials

Using a [unified configuration file](#section-unified-configuration-file) is the preferred method for storing your Seven Bridges credentials. However, Seven Bridges client applications and libraries will check for your credentials in the following order:

* Explicit parameters passed during initialization
* Environmental variables available on an OS level which are defined by users. Credentials can be stored using using the following environmental variables: `SB_API_ENDPOINT` and `SB_AUTH_TOKEN`.
* Unified configuration file which stores your credentials for all Seven Bridges client applications and libraries. This is the preferred method for storing your credentials. Learn more about the [unified configuration file](#section-unified-configuration-file) below.
* Application or library -specific configuration file which stores your credentials for a specific Seven Bridges client application or library.

Note that the previously used configuration file (such as .sbgrc or .sbg.auth.yml) is no longer supported by [sevenbridges-r starting from version 1.5.5](https://github.com/sbg/sevenbridges-r/releases/tag/v1.5.5) and sevenbridges-python starting from [version 0.7.0](https://github.com/sbg/sevenbridges-python/blob/develop/CHANGES.md).

\##Unified configuration file

Use a unified configuration file to store all of your credentials for Seven Bridges client applications and libraries. The configuration file, `credentials`, is a INI-like file stored in a directory named `.sevenbridges` underneath your home directory. This location varies across operating systems, but would typically be:

* (for Linux and Mac OS X) `$HOME/.sevenbridges/credentials`
* (for MS Windows) `%UserProfile%\.sevenbridges\credentials`

The `credentials` configuration file should contain key-value pairs of the following form:

[block:code]
{
  "codes": [
    {
      "code": "api_endpoint = https://api.sbgenomics.com/v2\nauth_token = 2cba934ad7094809bf1700cd80751745\n",
      "language": "text",
      "name": "Key-value pairs for the configuration file"
    }
  ]
}
[/block]

The above key-value pairs comprise one profile. Each profile's name precedes the relevant key-value pairs and is enclosed in brackets. The `credentials` file can consist of multiple profiles, as shown below. For instance, users may have multiple accounts on the same environment:

[block:code]
{
  "codes": [
    {
      "code": "[default]\napi_endpoint = https://cgc-api.sbgenomics.com/v2\nauth_token = 2cba934ad7094809bf1700cd80751745\n\n[sbpla]\napi_endpoint = https://api.sbgenomics.com/v2\nauth_token = d7090174092cba934a485cd8075bf170\n\n[sbpla-gcp]\napi_endpoint = https://gcp-api.sbgenomics.com/v2\nauth_token = 90d70172c409ba48934a5c750d80bf17",
      "language": "text",
      "name": "Sample configuration file content"
    }
  ]
}
[/block]

Note that each profile must have exactly one `api_endpoint` and one `auth-token` key with their corresponding values.