You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: build/12-embedded-wallets-integration.md
+72-21
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ export default defineConfig({
45
45
To use the Embedded wallet UI, your Next app has to be in `app router` mode. When in `pages routing` mode, global CSS file imports throw an error. [Github Discussion](https://github.com/vercel/next.js/discussions/27953)
46
46
47
47
Embedded wallet relies on browser APIs and it doesn't make sense to run it server-side.
48
-
To avoid errors, the component including `<WalletWidget />` should be marked with `'use client';`
48
+
To avoid errors, the component including `<EmbeddedWallet />` should be marked with `'use client';`
49
49
50
50
HTTPS needs to be configured even for localhost, so that authentication can work accross multiple domains.
51
51
In Next.js you can do this by adding `--experimental-https` to dev command.
@@ -87,7 +87,7 @@ To avoid errors, wrap the wallet with `<ClientOnly />`.
87
87
```vue
88
88
<template>
89
89
<ClientOnly>
90
-
<WalletWidget clientId="..." />
90
+
<EmbeddedWallet clientId="..." />
91
91
</ClientOnly>
92
92
</template>
93
93
```
@@ -154,9 +154,9 @@ Replace the parameters with however you wish to setup your wallet.
| clientId |`string`| Yes | UUID of the integration that you obtain when creating it on the [Apillon embedded wallet dashboard](https://app.apillon.io/dashboard/service/embedded-wallet). |
224
-
| defaultNetworkId |`number`| No | Chain ID set as default when opening wallet. |
225
-
| networks |`Network[]`| No | Array of network specifications |
226
-
| broadcastAfterSign |`boolean`| No | Automatically broadcast with SDK after confirming a transaction. |
227
-
| disableDefaultActivatorStyle |`boolean`| No | Remove styles from "open wallet" button |
228
-
| authFormPlaceholder |`string`| No | Placeholder displayed in input for username/email |
| clientId |`string`| Yes | UUID of the integration that you obtain when creating it on the [Apillon embedded wallet dashboard](https://app.apillon.io/dashboard/service/embedded-wallet). |
224
+
| passkeyAuthMode |`AuthPasskeyMode`| No | Method for authenticating with passkey to make it global. Default is `redirect`|
225
+
| defaultNetworkId |`number`| No | Chain ID set as default when opening wallet. |
226
+
| networks |`Network[]`| No | Array of network specifications |
227
+
| broadcastAfterSign |`boolean`| No | Automatically broadcast with SDK after confirming a transaction. |
228
+
| disableDefaultActivatorStyle |`boolean`| No | Remove styles from "open wallet" button |
229
+
| authFormPlaceholder |`string`| No | Placeholder displayed in input for username/email |
| id |`number`| The unique Chain ID of the network |
252
+
| rpcUrl |`string`| The URL to the network's RPC server |
253
+
| explorerUrl |`string`| The URL to the network's block explorer |
254
+
| imageUrl |`string`| Optional. Icon of the chain for display in UI |
255
+
| currencySymbol |`string`| Optional. Symbol of the native currency (default is 'ETH') |
256
+
| currencyDecimals |`number`| Optional. Number of decimals of the native currency (default is 18) |
244
257
245
258
### Button style
246
259
@@ -380,6 +393,25 @@ const signer = new EmbeddedEthersSigner();
380
393
awaitsigner.signMessage("test message");
381
394
```
382
395
396
+
::: warning
397
+
Beware when changing wallet chain after initializing any ethers object (e.g. `const myContract = new ethers.Contract(..., signer);`).
398
+
These objects are not reactive by default, so the previous chain will be used.
399
+
400
+
Events `'chainChanged'` and `'dataUpdated'` on `embeddedWallet.events` are emitted when wallet chain is updated, you can use these events to reinitialize any stale objects.
Beware when changing wallet chain after initializing any viem object with a specific chain (e.g. `constwalletClient=createWalletClient(...);`).
452
+
If not changed, this chain will be used even after changing chain in the wallet.
453
+
454
+
Events `'chainChanged'` and `'dataUpdated'` on `embeddedWallet.events` are emitted when wallet chain is updated, you can use these events to reinitialize any stale objects (or update reactive state e.g.).
We provide an **EIP-1193** provider that can be used with [Wagmi](https://wagmi.sh/) or any other integration that supports it.
@@ -545,7 +596,7 @@ document
545
596
546
597
## Create custom UI
547
598
548
-
All the functionalities of embedded wallets are contained in base package `@apillon/wallet-sdk`. The SDK exposes all the core methods of the wallet and you can create completely custom UI of the wallet on top of it.
599
+
All the functionalities of embedded wallets are contained in base package `@apillon/wallet-sdk`. The SDK exposes all the core methods of the wallet and you can create a completely custom UI of the wallet on top of it.
549
600
550
601
::: tip
551
602
For detailed technical documentation about the embedded wallet SDK, visit [the github repository](https://github.com/Apillon/embedded-wallet/tree/main/packages/sdk)
0 commit comments