@@ -49,83 +49,13 @@ Here is an example of a `Connectkit.tsx` file (based on Next.js) exporting the `
4949import React from " react" ;
5050import { ConnectKitProvider , createConfig } from " @particle-network/connectkit" ;
5151import { 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
6052import { 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
7754const 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+
13871Then, wrap your application with the ` ParticleConnectkit ` component. Here is an example of a ` layout.tsx ` file:
13972
14073``` ts
0 commit comments