Skip to content

Commit 42712d4

Browse files
committed
Update Particle tutorial
1 parent 02a653b commit 42712d4

File tree

2 files changed

+8
-75
lines changed

2 files changed

+8
-75
lines changed

docs/tools/wallets/particle-network.md

Lines changed: 7 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -49,83 +49,13 @@ Here is an example of a `Connectkit.tsx` file (based on Next.js) exporting the `
4949
import React from "react";
5050
import { ConnectKitProvider, createConfig } from "@particle-network/connectkit";
5151
import { authWalletConnectors } from "@particle-network/connectkit/auth";
52-
import type { Chain } from "@particle-network/connectkit/chains";
53-
// embedded wallet start
54-
import { EntryPosition, wallet } from "@particle-network/connectkit/wallet";
55-
// embedded wallet end
56-
// aa start
57-
import { aa } from "@particle-network/connectkit/aa";
58-
// aa end
59-
// evm start
6052
import { polygon, polygonAmoy } from "@particle-network/connectkit/chains";
61-
import {
62-
evmWalletConnectors,
63-
passkeySmartWallet,
64-
} from "@particle-network/connectkit/evm";
65-
// evm end
66-
67-
const projectId = process.env.NEXT_PUBLIC_PROJECT_ID as string;
68-
const clientKey = process.env.NEXT_PUBLIC_CLIENT_KEY as string;
69-
const appId = process.env.NEXT_PUBLIC_APP_ID as string;
70-
const walletConnectProjectId = process.env
71-
.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID as string;
72-
73-
if (!projectId || !clientKey || !appId) {
74-
throw new Error("Please configure the Particle project in .env first!");
75-
}
7653

7754
const config = createConfig({
78-
projectId,
79-
clientKey,
80-
appId,
81-
appearance: {
82-
// optional, sort wallet connectors
83-
connectorsOrder: ["passkey", "social", "wallet"],
84-
recommendedWallets: [
85-
{ walletId: "metaMask", label: "Recommended" },
86-
{ walletId: "coinbaseWallet", label: "Popular" },
87-
],
88-
language: "en-US",
89-
},
90-
walletConnectors: [
91-
authWalletConnectors({
92-
authTypes: ["google", "apple", "twitter", "github"], // Optional, restricts the types of social logins supported
93-
}),
94-
// evm start
95-
evmWalletConnectors({
96-
// TODO: replace it with your app metadata.
97-
metadata: {
98-
name: "Connectkit Demo",
99-
icon:
100-
typeof window !== "undefined"
101-
? `${window.location.origin}/favicon.ico`
102-
: "",
103-
description: "Particle Connectkit Next.js Scaffold.",
104-
url: typeof window !== "undefined" ? window.location.origin : "",
105-
},
106-
walletConnectProjectId: walletConnectProjectId,
107-
connectorFns: [passkeySmartWallet()],
108-
multiInjectedProviderDiscovery: false,
109-
}),
110-
111-
// evm end
112-
],
113-
plugins: [
114-
// embedded wallet start
115-
wallet({
116-
visible: true,
117-
entryPosition: EntryPosition.BR,
118-
}),
119-
// embedded wallet end
120-
121-
// aa config start
122-
// With Passkey auth use Biconomy or Coinbase
123-
aa({
124-
name: "BICONOMY",
125-
version: "2.0.0",
126-
}),
127-
// aa config end
128-
],
55+
projectId: process.env.NEXT_PUBLIC_PROJECT_ID!,
56+
clientKey: process.env.NEXT_PUBLIC_CLIENT_KEY!,
57+
appId: process.env.NEXT_PUBLIC_APP_ID!,
58+
walletConnectors: [authWalletConnectors({})],
12959
chains: [polygon, polygonAmoy],
13060
});
13161

@@ -135,6 +65,9 @@ export const ParticleConnectkit = ({ children }: React.PropsWithChildren) => {
13565
};
13666
````
13767

68+
!!! note ""
69+
This is a minimal version of the ConnectKit.tsx file, providing just enough to get started. For complete details and full implementation guidelines, refer to the [Particle Network documentation](https://developers.particle.network/api-reference/connect/desktop/web#configuration).
70+
13871
Then, wrap your application with the `ParticleConnectkit` component. Here is an example of a `layout.tsx` file:
13972

14073
```ts

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ nav:
545545
- Venly widget: tools/wallets/venly/venly-widget.md
546546
- Fortmatic: https://docs.fortmatic.com/
547547
- Openfort: tools/wallets/openfort.md
548-
- Particle network: tools/wallets/particle-network.md
548+
- Particle Network: tools/wallets/particle-network.md
549549
- Portis: tools/wallets/portis.md
550550
- Torus: tools/wallets/torus.md
551551
- WalletConnect: tools/wallets/walletconnect.md

0 commit comments

Comments
 (0)