Overview:
The Sveltekit + Web3auth project aims to integrate web3auth via MetaMask with a JWT Issuing auth server from a confidential client for use with APIs in Sveltekit. This integration allows for a seamless login process, with navigation to protected pages of the app not requiring a request to the Authorization Server. Sveltekit hooks take care of the client-side implementation, ensuring a smooth user experience.
Features:
- Integration of web3auth via MetaMask with a JWT Issuing auth server.
- Seamless login process without requiring a request to the Authorization Server for protected page navigation.
- Use of Sveltekit hooks to handle the client-side implementation.
Installation:
- Clone or download the Sveltekit + Web3auth template from the repository: GitHub - CloudNativeEntrepreneur/sveltekit-web3auth-template
- Install the necessary dependencies by running the command
npm ciin the project directory. - Set up the server by using the provided server from GitHub - CloudNativeEntrepreneur/web3-auth-service.
- Create an
.envfile in the project root directory and add the following content:
VITE_WEB3AUTH_CLIENT_SECRET=[your_client_secret]
- Copy the
src/routes/authfolder,src/configfolder,src/hooks.tsfile, andsrc/routes/__layout.sveltefile from thesveltekit-web3authsource repository to the corresponding locations in your own SvelteKit project. - Replace imports of
$libwithsveltekit-web3auth. - Optionally, copy the
routes/graphqlandroutes/profilefolders from the source repository to your own project and customize them as needed. - Use the provided stores for auth information in your protected routes.
Summary:
The Sveltekit + Web3auth project provides a seamless integration of web3auth via MetaMask with a JWT Issuing auth server, enabling secure authentication within an API-driven Sveltekit application. The use of Sveltekit hooks simplifies the client-side implementation, ensuring a smooth and user-friendly login process. With easy-to-follow installation instructions, developers can quickly get started with this project and customize it to fit their specific requirements.