# Connect

## Connect Method

Picket client SDKs contain a convenience method for connecting to wallets

{% tabs %}
{% tab title="Ethereum" %}

```typescript
// default is the Ethereum mainnet
picket.connect();
// you can also pass the "ethereum" explicitly
// picket.connect({ chain: "ethereum" });
```

{% endtab %}

{% tab title="Solana" %}

```typescript
picket.connect({ chain: "solana" });
```

{% endtab %}
{% endtabs %}

`picket.connect()` triggers a wallet connection request which involves a pop up and/or redirect that will ask users to connect to any supported wallet of a [picket supported blockchain](/picket-docs/reference/concepts/supported-blockchains.md).&#x20;

It also triggers a picket compatible [signature](/picket-docs/reference/concepts/signatures.md) request for you that leverages a secure picket generated nonce.

![](/files/je3NMLW4waDaKflk7swj)

Once the user connects their wallet and signs the message, you will receive a response with a Picket wallet object that contains the walletAddress, signature and provider which can be used for future on-chain operations with your [web3 library](/picket-docs/reference/concepts/open-source-web3-client-libraries.md) of choice.

### When to Use

`picket.login()` handles calling the `picket.connect()` function for you. So, if you're using `picket.login()` you don't need to manually call `picket.connect()` However, if you want to have access to a wallet for future on chain operations then the `picket.connect()` method is an easy and convenient way to accomplish that. You can use it alongside `picket.login()` like so:&#x20;

```typescript
import Picket from "@picketapi/picket-js"
const picket = new Picket('YOUR_PUBLISHABLE_KEY_HERE')

const { walletAddress, signature, provider } = await picket.connect()
const { accessToken } = await picket.login({ walletAddress, signature })
```

By using the `connect()` method here, you not only authenticate the wallet, you can also now use `provider` for future on chain interactions. For example, in order to get the wallet balance of the connected wallet you can do the following using the `ethers.js` library.

```javascript
import { ethers } from "ethers";

const wallet = new ethers.providers.Web3Provider(provider);
const signer = wallet.getSigner();
await signer.getBalance()
```

## Anatomy of a Connect Response

```json
{
    address: "0x...abc",
    signature: "0xSignature",
    provider: {providerObject},
    // only returned when signing a SIWE-formatted message
    context: {
        domain: "example.com",
        uri: "https://example.com/login",
        chainID: 137,
        issuedAt: "2022-06-10T12:14:28Z"
    },
}
```

<table><thead><tr><th width="200">Property</th><th width="481.3333333333333">Description</th><th data-hidden></th><th data-hidden></th></tr></thead><tbody><tr><td><code>address</code></td><td>The connected walletAddress</td><td></td><td></td></tr><tr><td><code>signature</code></td><td>A valid picket <a href="/pages/dRpPOqOVSOwREaeIDnse">signature </a>signed by the wallet</td><td></td><td></td></tr><tr><td><code>provider</code></td><td>A ethers.js and web3.js compatible wallet provider object that can  be used to facilitate on-chain operations via these <a href="/pages/3G0odfg5YEcPTvcjCTaA">open source libraries</a>.  </td><td></td><td></td></tr><tr><td><code>context</code></td><td>The signing context for SIWE messages. This is needed to allow the server to verify the message signature.</td><td></td><td></td></tr></tbody></table>

## Supported Wallets

### EVM-Compatible Chains

While you can pass in a `walletAddress` and `signature` signed by any wallet. Currently `picket.connect()` makes over 100 wallets available to users via the convenient ready-built Picket connect UI. These include:

* Metamask (And any browser injected wallet)
* [Wallet Connect Compatible Wallets](https://walletconnect.com/registry?type=wallet) (Rainbow, Trust, Gnosis Multisig, Crypto.com, etc.)
* Coinbase Wallet

If there is a wallet, or wallet standard you would like supported let us know: <team@picketapi.com>.&#x20;

You can also build your own UI to let users select a wallet to connect to and/or use an open source 3rd party UI for this like [Web3Modal](https://github.com/Web3Modal/web3modal). You can then follow the [manual signing auth flow](/picket-docs/reference/concepts/auth-flow.md) in order to use picket to verify ownership of the wallet and enable token gating.

### Solana

On Solana, `picket.connect()` currently supports the [Phantom Wallet](https://phantom.app/) and [Solflare Wallet](https://solflare.com/).

If there is a Solana wallet, or wallet standard you would like supported let us know: <team@picketapi.com>.&#x20;


---

# Agent Instructions: 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:

```
GET https://docs.picketapi.com/picket-docs/reference/concepts/connect.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
