Skip to content

Commit

Permalink
GITBOOK-41: added: connect via connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
f.schoenknecht authored and gitbook-bot committed Dec 3, 2024
1 parent 1c51034 commit 81fdca4
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion getting-started/implementation-guide/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,28 @@ TConnectTezosBeaconProviderOptions {
```

{% hint style="info" %}
If no walletApp is provided when creating the provider, a wallet connection can be established using a connection string. However, if you intend to connect to a wallet represented by the type `EvmWalletApp, TezosBeaconWalletApp or TezosWcWalletApp` it is recommended to provide it explicitly.
If no walletApp is provided when creating the provider, a wallet connection can be established using the connection string. However, if you intend to connect to a wallet represented by the type `EvmWalletApp, TezosBeaconWalletApp or TezosWcWalletApp` it is recommended to provide it explicitly.
{% endhint %}

### Connect via connection string

```typescript
// Import provider
import { TConnectEvmProvider } from '@tconnect.io/evm-provider';

// Initialize provider
const provider = new TConnectEvmProvider({
appName: "Example App",
appUrl: "https://your-domain.io",
bridgeUrl: "https://tconnect.io",
apiKey: "PRIVATE_API_KEY",
});

// Listen for 'connectionString' event
provider.on("connectionString", (connectionString) => {
console.log(connectionString);
});

// Connect to wallet
await provider.connect();
```

0 comments on commit 81fdca4

Please sign in to comment.