# Mode

![mode_logo.png](https://assets.relyanceuat.xyz/images/docs/10964812033933/10964529204365.png)
Mode is a cloud-based collaborative analytics platform that helps business teams efficiently analyze data and share their findings. It combines SQL, Python, R and visual analysis to answer questions faster.

In order to integrate Mode with Relyance AI you will need a **Token** and **Password**.

#### In Mode:

1. Login to your Mode account.
2. Go to the access token page here: [https://app.mode.com/settings/access_tokens](https://app.mode.com/settings/access_tokens)
3. In the **Create New Access Token** section provide a meaningful name and click the **Create token** button.
4. Copy the generated **Token** and **Password** to be used in Relyance.

![Mode-3.png](https://assets.relyanceuat.xyz/images/docs/10964812033933/10965073464845.png)

![Mode-4.png](https://assets.relyanceuat.xyz/images/docs/10964812033933/10965073463821.png)

#### In the Relyance AI application:

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Click on the **Vendor Integration** tab.
5. Find the **Mode** integration card and click it to open its connections.
6. Under **Authentication Method**, choose **Custom**.
8. Paste the **Token** **Password** into their respective fields.

![Mode-1.png](https://assets.relyanceuat.xyz/images/docs/10964812033933/10964749083149.png)

The **Authentication** step asks for:

- Using **Custom** —
    - **Token**: required; held as a secret.
    - **Password**: required; held as a secret.
- Using **Workspace API Token** —
    - **Token**: required; held as a secret.
    - **Secret**: required; held as a secret.

9. Click **Authenticate**.
10. At this point, you should see the following result on the **Vendor** Integrations page:

![Mode-2.png](https://assets.relyanceuat.xyz/images/docs/10964812033933/10964773963533.png)

11. Congratulations, you are now connected to **Mode**.

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

### Access token

```hcl
resource "relyance_integration_connection" "mode_0" {
  vendor = "mode"
  name   = "<your connection name>"

  auth = {
    method = "access-token"
    params = {
      data_storage_location = "us"
    }
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      token = var.mode_token
      pwd = var.mode_pwd
    }
    secrets_wo_version = 1
  }

  scans = { "data-inspection" = { enabled = true } }
}
```

### Access token — Workspace API Token

```hcl
resource "relyance_integration_connection" "mode_1" {
  vendor = "mode"
  name   = "<your connection name>"

  auth = {
    method = "access-token-workspace-api"
    params = {
      data_storage_location = "us"
    }
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      token = var.mode_token
      secret = var.mode_secret
    }
    secrets_wo_version = 1
  }

  scans = { "data-inspection" = { enabled = true } }
}
```

<!-- terraform-examples:end -->
