> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/build-and-test-execution/integration-build/integration-build-explicit-components-and-versions/retrieve-component-bsids.md).

# Retrieve Component BSIDs

Few DevOps mechanisms are available to streamline the work with Sealights' Integration Builds.

## Pulling the BSID dynamically from the component <a href="#pulling-the-bsid-dynamically-from-the-component" id="pulling-the-bsid-dynamically-from-the-component"></a>

When creating the Integration Build, you’ll query one by one the components deployed in the relevant (and common Testing Lab) to retrieve their BSID.

{% hint style="info" %}
This option is commonly used when working with containers and orchestration.
{% endhint %}

### Java built with Sealights plugins. <a href="#java-built-with-sealights-plugins" id="java-built-with-sealights-plugins"></a>

Sealights Maven and Gradle plugins allow to include resource text files to the artefact.

You can extract the `buildSessionId.txt` file from the Java artefact by using the following command:

{% code overflow="wrap" lineNumbers="true" %}

```
java xvf myapp.jar buildSessionId.txt
```

{% endcode %}

### Node/Javascript <a href="#node-javascript" id="node-javascript"></a>

You can extract the Build Session ID of your JS component from the instrumented files using the regular grep command:

{% code overflow="wrap" lineNumbers="true" %}

```
cat main.js | grep buildSessionId
```

{% endcode %}

The output is `"buildSessionId": "89b2477d-fed3-400d-b63f-f1ba133f5080",`

{% hint style="info" %}
Another solution is to copy the `buildSessionId` file into the instrumented folder when packaging it and read the content of this file to retrieve the unique ID when needed.\
This solution is often prefered when the application’s JS files are big.
{% endhint %}

## Storing the BSIDs of the components in a central place <a href="#storing-the-bsids-of-the-components-in-a-central-place" id="storing-the-bsids-of-the-components-in-a-central-place"></a>

A second common solution is to store the buildSessionID of every component in a central place (database, folder component-specific,…) and create the Integration Build from these IDs.

For example, you can use a dedicated Variable Group in AzureDevOps Library section like in the image below:

<figure><img src="/files/wbzQnp8WWJaSp5JLSGLZ" alt=""><figcaption></figcaption></figure>

## Using Sealights' Public API <a href="#using-sealights-public-api" id="using-sealights-public-api"></a>

### Resolving dynamically the components' details <a href="#resolving-dynamically-the-components-details" id="resolving-dynamically-the-components-details"></a>

A third common solution is to use Sealights Public APIs to programmatically retrieve the BSID of every component using specific criteria (the last build, a specific build from a certain date, build matching a certain naming convention…).

Please refer to the Sealights API Reference page for more details, specifically about entry points like:

* `/sl-api/v1/slim-builds` (*Get Builds API*)
* or `/sl-api/v1/slim-builds/resolve` (*Resolve Builds API*).

### Capturing the list of all active agents from a specific environment <a href="#capturing-the-list-of-all-active-agents-from-a-specific-environment" id="capturing-the-list-of-all-active-agents-from-a-specific-environment"></a>

Another solution is to take a snapshot of your environment by capturing all the agents up and running from that specific environment at the creation of your Integration Build.\
This last solution relies on several technical assumptions and is a good starting point but not recommended as a persistent solution.

More details are shared in our dedicated documentation page:[JSON File Listing Components](/knowledgebase/setup-and-configuration/build-and-test-execution/integration-build/integration-build-explicit-components-and-versions/json-file-listing-components.md#using-the-list-of-agents-currently-active-in-a-specific-environment)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/build-and-test-execution/integration-build/integration-build-explicit-components-and-versions/retrieve-component-bsids.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
