StarknetKit
Docs
Connectors

Connectors

Introduction to Connectors

We've borrowed the concept of connectors from starknet-react to make StarknetKit, the perfect modular library for interacting with Starknet dapps.

Connectors are simply components that enable you interact with different Wallet providers on Starknet. Currently we support 3 connectors by default:

But thanks to the modular design we've utilized, you can decide which connectors to show/hide on your dapp by adding a few lines of codes which we'll go over in the next sections.

ℹ️

Got a missing connector? you can submit a PR to the official StarknetKit repository (opens in a new tab) to add your own custom connectors!

Using connectors as standalone

In the usage section, you saw how you can prompt the user to choose to which wallet he wants to connect using connect. But, you might want to use only one wallet for some reason, in that case, you can use connect returned by the connector.

import { InjectedConnector } from "starknetkit/injected"
 
const connector = new InjectedConnector({ options: { id: "argentX" } });
 
await connector.connect()
// or disconnecting
await connector.disconnect()