> ## Documentation Index
> Fetch the complete documentation index at: https://docs.methodfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect

> [!NOTE]
>
> Mode: `connect`

Opal Connect is the primary way to connect user liability accounts with Method.
This pre-built flow gathers a user's consent, verifies their identity, and completes any needed verifications to ensure their accounts are connected to the Method ecosystem.

![connect-hero](https://mintcdn.com/methodfinancial/eYCszB8Xv_iFcf77/images/connect-hero.svg?fit=max\&auto=format\&n=eYCszB8Xv_iFcf77\&q=85\&s=be7a6b5840a512b80707df91e7d31fdd)

## What this mode does

Connect lets users find and connect their liability accounts (credit cards, loans, mortgages, etc.). Configure whether users may select a single account, multiple accounts, or by default select all eligible accounts.

## Parameters

## Create a token

You can create a connect session token using one of the supported patterns:

* Existing entity: provide `entity_id` + `mode` + `connect`
* Create new entity: provide `entity` + `mode` + `connect`
* Resume session: provide `session_id` only (omit `mode` and `connect`)

### Existing Entity

```json theme={null}
{
  "entity_id": "ent_...",
  "mode": "connect",
  "connect": {
    "selection_type": "single",
    "account_filters": {
      "include": {
        "account_types": ["credit_card", "auto_loan"],
        "products": ["balance"]
      }
    }
  }
}
```

### Create New Entity

```json theme={null}
{
  "entity": {
    "type": "individual",
    "individual": {
      "first_name": "Kevin",
      "last_name": "Doyle",
      "phone": "+15125551234"
    }
  },
  "mode": "connect",
  "connect": {
    "selection_type": "multiple",
    "account_filters": {
      "exclude": {
        "account_types": ["personal_loan"],
        "mch_ids": ["mch_123"],
        "unverified_account_numbers": true
      }
    }
  }
}
```

### Response

```json theme={null}
{
  "token": "otkn_...",
  "valid_until": "2025-06-10T22:50:53.024Z",
  "session_id": "osess_..."
}
```

## Launch Opal

> [tab] React (Web)
>
> ```tsx theme={null}
> import { OpalProvider, useOpal } from "@methodfi/opal-react";
>
> function Screen() {
>   const { open } = useOpal({ env: "dev", onEvent: (e) => {} });
>   const start = async () => {
>     const { token } = await getTokenFromBackend();
>     open({ token });
>   };
>   return <button onClick={start}>Connect Accounts</button>;
> }
> ```

> [tab] React Native
>
> ```tsx theme={null}
> import { OpalProvider, useOpal } from "@methodfi/opal-react-native";
>
> function Screen() {
>   const { open } = useOpal({ env: "dev", onEvent: (e) => {} });
>   const start = async () => {
>     const { token } = await getTokenFromBackend();
>     open({ token });
>   };
>   return <Button title="Connect Accounts" onPress={start} />;
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.