Installing Particle Auth
Configuring Particle Auth
projectId
, clientKey
, and appId
. These values fundamentally link your application with the Particle dashboard.To retrieve these values for configuration within your application, follow these steps:Access the Particle Dashboard
Create a new project or enter an existing project
Create a new web application, or skip this step if you already have one
Retrieve the project ID (`projectId`), the client key (`clientKey`), and the application ID (`appId`)
projectId
, clientKey
, and appId
retrieved, you’ll need to configure Particle Auth within your application through AuthCoreContextProvider
from @particle-network/authkit
, the primary React component responsible for initializing Particle Auth.Configuring `AuthCoreContextProvider`
AuthCoreContextProvider
component handles the configuration for Particle Auth. It’s best practice to place this configuration in a dedicated AuthKit.tsx
file within the src
directory, where you can set up and export the component.Once configured, you can use this export to wrap your main App
component, ensuring authentication is available throughout your application.Here’s an example of how to configure AuthCoreContextProvider
:Wrap your application with ParticleAuthkit
ParticleAuthKit
component, which is exported from AuthKit
.Here’s an example of how this might look in a layout.tsx
file:Facilitating logins
useConnect
, which contains a function, connect
, that directly facilitates wallet creation through social login.Upon logging in, the embedded wallet modal included with Particle Auth will be accessible through the button in the bottom right, unless otherwise specified through wallet
within AuthCoreContextProvider
.