What is Particle Network?
Particle Network is the Intent-Centric, Modular Access Layer of Web3. With Particle’s Smart Wallet-as-a-Service, developers can curate unparalleled user experience through modular and customizable EOA/AA embedded wallet components. By utilizing MPC-TSS for key management, Particle can streamline onboarding via familiar Web2 accounts—such as Google accounts, email addresses, and phone numbers.Prerequisites
Next.js Dapp with MetaMask Sign-In
Before you begin this tutorial, make sure you have set up a Next.js decentralized application (Dapp) that includes MetaMask sign-in functionality. If you haven’t integrated MetaMask sign-in yet, refer to the guide How to Authenticate Users with MetaMask.Install Dependencies
To prepare for this tutorial, you’ll need to install the following dependencies for Particle Connect:-
@particle-network/connect-react-ui: This package provides React UI components for Particle Connect. You can install it using npm or yarn.
or
-
@particle-network/connect: This package is essential for integrating Particle Connect into your Dapp. Install it using npm or yarn.
or
-
@particle-network/chains: This optional dependency is leveraged for handling blockchain chains within Particle Connect. You can install it using npm or yarn.
or
Configure Particle Connect
Open thepages/signin.jsx file and restructure your code as shown below. This code utilizes Particle Connect’s components and hooks for handling the connection process and wallet interactions.
Test Particle Connect
To test the authentication process with Particle Connect, follow these steps:- Visit Sign-In Page: Go to
http://localhost:3000/signin. - Connect Wallet: Click the “Connect Wallet” button to initiate the login process. You can choose to log in through Particle Auth or a supported Web3 (EVM) wallet.
- Select Sign-In Method: Choose your preferred sign-in method from the options provided.
- Successful Authentication: After successful authentication, you will be automatically redirected to the
/userpage. - Test User Session: Visit
http://localhost:3000/userto test the functionality of the user session:- When a user is authenticated, their information will be displayed on the page.
- If a user is not authenticated, they will be redirected to the
/signinpage. - Even after refreshing the page, the user’s information will still be displayed. (
Explanation: After Web3 wallet authentication, the next-auth library creates a session cookie with an encrypted [JWT] containing session information, stored in the user's browser.)

