|
1 | | -# Web3Auth Modal AA Quick Start |
2 | | - |
3 | | -[](https://community.web3auth.io) |
4 | | - |
5 | | -[Join our Community Portal](https://community.web3auth.io/) to get support and stay up to date with the latest news and updates. |
6 | | - |
7 | | -This example demonstrates how to use Web3Auth [Account abstraction provider](https://www.npmjs.com/package/@web3auth/account-abstraction-provider) with Web3Auth Modal in React. |
8 | | - |
9 | | -## Getting Started |
10 | | - |
11 | | -1. Download Manually |
12 | | - |
13 | | -```bash |
14 | | -npx degit Web3Auth/web3auth-pnp-examples/web-modal-sdk/account-abstraction/aa-modal-quick-start w3a-aa-example |
15 | | -``` |
16 | | - |
17 | | -2. Navigate into the project directory |
18 | | - |
19 | | -```bash |
20 | | -cd w3a-aa-example |
21 | | -``` |
22 | | - |
23 | | -3. Install dependencies |
24 | | -```bash |
25 | | -npm install |
26 | | -``` |
27 | | - |
28 | | -## Setup |
29 | | -Set up the required environment variables by creating a `.env` file in the root of the project. Follow the instructions in the Environment Variables section. |
30 | | - |
31 | | -Here is an example `.env` file template |
32 | | - |
33 | | -``` |
34 | | -VITE_API_KEY = "YOUR_PIMLICO_API_KEY" |
| 1 | +# React + TypeScript + Vite |
| 2 | + |
| 3 | +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. |
| 4 | + |
| 5 | +Currently, two official plugins are available: |
| 6 | + |
| 7 | +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh |
| 8 | +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh |
| 9 | + |
| 10 | +## Expanding the ESLint configuration |
| 11 | + |
| 12 | +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: |
| 13 | + |
| 14 | +```js |
| 15 | +export default tseslint.config({ |
| 16 | + extends: [ |
| 17 | + // Remove ...tseslint.configs.recommended and replace with this |
| 18 | + ...tseslint.configs.recommendedTypeChecked, |
| 19 | + // Alternatively, use this for stricter rules |
| 20 | + ...tseslint.configs.strictTypeChecked, |
| 21 | + // Optionally, add this for stylistic rules |
| 22 | + ...tseslint.configs.stylisticTypeChecked, |
| 23 | + ], |
| 24 | + languageOptions: { |
| 25 | + // other options... |
| 26 | + parserOptions: { |
| 27 | + project: ['./tsconfig.node.json', './tsconfig.app.json'], |
| 28 | + tsconfigRootDir: import.meta.dirname, |
| 29 | + }, |
| 30 | + }, |
| 31 | +}) |
35 | 32 | ``` |
36 | | -<!-- markdown-link-check-disable-next-line --> |
37 | | -Get your pimlico API key from the [Pimlico Dashboard](https://dashboard.pimlico.io/) |
38 | 33 |
|
39 | | -## Run |
40 | | -To start the development, run the following command |
41 | | -```bash |
42 | | -npm run dev |
| 34 | +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: |
| 35 | + |
| 36 | +```js |
| 37 | +// eslint.config.js |
| 38 | +import reactX from 'eslint-plugin-react-x' |
| 39 | +import reactDom from 'eslint-plugin-react-dom' |
| 40 | + |
| 41 | +export default tseslint.config({ |
| 42 | + plugins: { |
| 43 | + // Add the react-x and react-dom plugins |
| 44 | + 'react-x': reactX, |
| 45 | + 'react-dom': reactDom, |
| 46 | + }, |
| 47 | + rules: { |
| 48 | + // other rules... |
| 49 | + // Enable its recommended typescript rules |
| 50 | + ...reactX.configs['recommended-typescript'].rules, |
| 51 | + ...reactDom.configs.recommended.rules, |
| 52 | + }, |
| 53 | +}) |
43 | 54 | ``` |
44 | | -## Important Links |
45 | | - |
46 | | -- [Website](https://web3auth.io) |
47 | | -- [Docs](https://web3auth.io/docs) |
48 | | -- [Guides](https://web3auth.io/docs/guides) |
49 | | -- [SDK / API References](https://web3auth.io/docs/sdk) |
50 | | -- [Pricing](https://web3auth.io/pricing.html) |
51 | | -- [Community Portal](https://community.web3auth.io) |
|
0 commit comments