> For the complete documentation index, see [llms.txt](https://docs.blocto.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blocto.app/~/changes/lJG0Ie43hDo96Dq7BMVa/blocto-sdk/javascript-sdk/solana/connect-to-blocto-wallet.md).

# Connect to Blocto wallet

Before you started to interact with blocto wallet, you need to fire a connect request.

Once the connection request is fired, there would be a prompt modal to guide user to register/login to Blocto wallet.

```javascript
import BloctoSDK from "@blocto/sdk";

const bloctoSDK = new BloctoSDK({
  solana: {
    net: "devnet"
  }
});
const connectWallet = async () {
    try {
        const accounts = await bloctoSDK?.solana?.request({ method: "connect" }); // wallet address
    } catch (error) {
        console.error(error)
    }
}

const disconnectWallet = async () {
    try {
        await bloctoSDK?.solana?.request({ method: "disconnect" });
    } catch (error) {
        console.error(error)
    }
}
```

{% embed url="<https://codesandbox.io/s/sol-login-wgc4b6?file=/src/App.js>" %}
