# CodeScan and Flosum Integration

## About Flosum <a href="#about-flosum" id="about-flosum"></a>

**Flosum** is a release management tool for the Salesforce platform. Flosum users can now integrate CodeScan in their deployments to achieve secure, error-free releases.

{% hint style="info" %}
**Note**: Flosum cannot be integrated with On-Premises/Self-Hosted versions of CodeScan.
{% endhint %}

## How to Integrate Flosum with CodeScan <a href="#how-to-integrate-flosum-with-codescan" id="how-to-integrate-flosum-with-codescan"></a>

1. **Install CodeScan.**&#x20;
   1. Obtain the CodeScan package URL from your Flosum Customer Success Manager.&#x20;
   2. Install the CodeScan package in your Flosum organization.&#x20;
   3. After installation, click on the app launcher and open Flosum-CodeScan.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FRDmt7C89hz1A2Bvjc3od%2Fimage.png?alt=media&#x26;token=51f2268e-76b1-4f6b-b2e7-255bff258711" alt=""><figcaption></figcaption></figure>

2. **Authorize** CodeScan.

   * Go to the **Authorization** tab in Flosum-CodeScan.\\

     <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FNcPNYvekIJbKRfZrQuD8%2Fimage.png?alt=media&#x26;token=f746eaf3-92d5-4d86-9347-50d2fb228265" alt=""><figcaption></figcaption></figure>

   * Enter the following details to sync CodeScan with your Flosum organization.
     * **CodeScan URL**: Use the appropriate URL for your CodeScan instance:
       * **US** region: [*https://app.codescan.io*](https://app.codescan.io)
       * **EU** region: [*https://app-eu.codescan.io*](https://app-eu.codescan.io)
       * **AUS** region: [*https://app-aus.codescan.io*](https://app-aus.codescan.io)
     * **Organization Key**: Obtain this key from your hosted CodeScan instance.
     * **Token**: Generate a token by navigating to **User > My Account > Security** in CodeScan. Set the token expiration or choose "no expiration."\\

       <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fg92jqIDIZ2WvIvwx2Ji4%2Fimage.png?alt=media&#x26;token=45e30e2e-f61b-4494-82c3-b2358744d7af" alt=""><figcaption></figcaption></figure>
3. **Flosum Branch Configuration**:
   1. On the **Branch Configuration** tab, choose the branch you want to scan.
      * Select all or specific component types from the six supported profiles:
        * Aura
        * Lightning
        * Apex Class
        * Apex Triggers
        * Apex Page
        * Component
      * Check the boxes for the components you want to scan and click **Save**.\\

        <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FNusuTNekBR13OIN4EP09%2Fimage.png?alt=media&#x26;token=441c4e46-86db-47f9-a8ab-4f601ebd3ffb" alt=""><figcaption></figcaption></figure>
4. **Finalize Setup**:&#x20;
   * Log in to CodeScan and confirm that your branch is populated in the CodeScan server. \\

     <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FRpL4zAV6eV2QzcBzUEsP%2Fimage.png?alt=media&#x26;token=2324e075-f88f-405c-bf09-81920b376765" alt=""><figcaption><p>Confirm branch population</p></figcaption></figure>
   * Select the branch, click **Add Analysis Project**, and attach it as a webhook.\\

     <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FcELpKZgiZIdtZP0RoGP4%2Fimage.png?alt=media&#x26;token=d13f3a09-9428-4ce2-94c3-d3a312f939b4" alt=""><figcaption><p>Attach Analysis to Project</p></figcaption></figure>

     <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FaeTnTMbQwuftyA1ZxGLc%2Fimage.png?alt=media&#x26;token=7aaae072-5ef2-4432-9449-218e61187638" alt=""><figcaption><p>Attach Analysis to Webhook</p></figcaption></figure>

## Initiating a Scan on the Flosum Branch

1. **Branch Sync**:
   * Add the **Branch Sync** lightning component to your branch's Lightning record page.
   * Click the **Branch Sync** button to trigger the static code analysis.\\

     <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F6DFRT8jwaRudjDZNl73Z%2Fimage.png?alt=media&#x26;token=f1cca27d-129e-40ba-867f-837650771b1a" alt=""><figcaption></figcaption></figure>
2. **View Project Analysis**:
   * Go to the **Project Analysis** page to see the analysis in progress.\\

     <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fbe6RuqPVn71k17Ze1Or5%2Fimage.png?alt=media&#x26;token=6ace034c-8446-4656-97b7-3c759c0a459b" alt=""><figcaption></figcaption></figure>

Your Flosum-CodeScan integration is complete!
