Commit 88dedbd
feat(wallets): add Web3Auth provider with secure key handling (#413)
* feat(*): add Web3Auth wallet support
introduce Web3Auth wallet integration with secure key handling. includes `SecureKeyContainer`, automatic memory zeroing, and enhanced cryptographic features. added relevant utility tests and optional peer dependencies.
* feat(use-wallet): add tests for deriveAlgorandAccountFromEd25519
introduce comprehensive test coverage for `deriveAlgorandAccountFromEd25519`, including Web3Auth-style key handling, key validation, transaction signing, and integration with `SecureKeyContainer`. added utility functions to enhance test clarity and realism.
* feat(*): enhance Web3Auth integration and update dependencies
improve Web3Auth integration with support for `CommonPrivateKeyProvider`, updated chain configuration for Algorand, and conditional inclusion based on `VITE_WEB3AUTH_CLIENT_ID`. refine error handling and logging for missing dependencies. update packages and add optional peer dependencies for Web3Auth. adjust test suite to reflect changes.
* feat(*): add support for Web3Auth custom authentication flows
extend Web3Auth wallet to support custom JWT-based authentication, such as Firebase integration. implement `Single Factor Auth` (SFA) SDK with dynamic imports and conditional usage. update the `Connect` component to enable custom auth configuration in the UI. enhance test suite to cover new functionality. update dependencies to include `@web3auth/single-factor-auth`.
* feat(Connect): add Firebase authentication support
integrate Firebase authentication into the `Connect` component, enabling sign-in with Google and Firebase UID-based authentication for Web3Auth wallet connections. include dynamic handling of Firebase state changes, conditional authentication configuration in the UI, and enhanced error management. update dependencies with Firebase packages and related utilities.
* feat(FirebaseAuth): add reusable Firebase authentication component
introduce `FirebaseAuth` component for streamlined Firebase authentication functionality, supporting Google sign-in and email/password authentication flows. improve state management and error handling with user-friendly messages. update `Connect` component to integrate `FirebaseAuth`, removing redundant logic. include added styles for the new component and update dependencies with `firebaseui`.
* style: format codebase with Prettier for CI compliance
Run Prettier across the codebase to ensure all files meet formatting
standards and CI checks pass.
- Update .prettierignore to exclude CLAUDE.md and .claude/ directory
- Format imports in firebase.ts for better readability
- Adjust comment formatting in web3auth.test.ts
- Add missing newline at end of secure-key.ts
* chore(deps): add tweetnacl for ed25519 key derivation
Add `tweetnacl` as a devDependency to resolve TypeScript compilation
errors in secure-key.ts. The library is used for ed25519 keypair
derivation in the Web3Auth wallet implementation, specifically for
converting 32-byte ed25519 seeds into Algorand-compatible accounts.
* chore: release v4.4.0-beta.0
* feat(Web3Auth): implement lazy authentication and automatic session refresh
introduce lazy authentication mechanism that defers Web3Auth connection until `signTransactions()` is called. add automatic session refresh for Single Factor Auth (SFA) via `getAuthCredentials` callback. implement separate reconnection flows for SFA and modal authentication. enhance security by verifying address matches after re-authentication and disconnecting wallet if user changes. update session resume to restore cached address without initializing Web3Auth. extend test suite with lazy authentication scenarios covering session expiry, re-authentication flows, and modal cancellation.
* chore: release v4.4.0-beta.1
* refactor(react-ts): separate Web3Auth modal and Firebase SFA flows
Restructure Web3Auth authentication in the example to clearly distinguish
between the two connection methods:
1. Standard Modal SDK - Uses Web3Auth's built-in UI for social logins
2. Firebase SFA - Uses Firebase JWT for single-factor authentication
UI changes:
- Replace checkbox toggle with separate "or connect with Firebase" section
- Add section divider styling for visual separation
- Fix button text wrapping with `white-space: nowrap`
- Add `input[type='password']` to global input styles for consistency
- Remove redundant custom styles for auth form inputs and buttons
This separation makes the two authentication flows explicit and easier to
understand for developers reviewing the example.
* fix(Web3Auth): log actual error when package loading fails
Include the caught error in the log output to help diagnose
dynamic import failures (e.g., missing dependencies or bundler
polyfill issues).
* feat(examples): add Web3Auth and Firebase authentication
Add Web3Auth wallet provider with Firebase Single Factor Authentication
(SFA) support to all remaining example applications.
## Changes per example
- nextjs: Add firebase.ts, FirebaseAuth.tsx, update Connect.tsx and providers.tsx
- vue-ts: Add firebase.ts, FirebaseAuth.vue, update Connect.vue and main.ts
- nuxt: Add firebase.ts, FirebaseAuth.vue, polyfills.client.ts for Web3Auth compatibility
- solid-ts: Add firebase.ts, FirebaseAuth.tsx, update Connect.tsx and App.tsx
- svelte-ts: Add firebase.ts, FirebaseAuth.svelte, update connect.svelte and +layout.svelte
- vanilla-ts: Add firebase.ts, FirebaseAuthComponent.ts, update WalletComponent.ts and main.ts
## Additional fixes
- Add password input styling to vue-ts and solid-ts global CSS
- Add .env.example files with Web3Auth and Firebase configuration templates
- Nuxt requires manual polyfills plugin due to vite-plugin-node-polyfills incompatibility
* refactor(examples): simplify Web3Auth demos by removing custom auth complexity
The Firebase authentication integrations add significant complexity to what
should be simple, focused wallet integration demos. This simplifies all
example applications to use only the Web3Auth modal for social login,
providing a cleaner developer experience.
Changes:
- Remove Firebase SDK dependency from all 7 example apps
- Remove Firebase auth components and utility files
- Remove Firebase-related CSS styles
- Simplify .env.example files to only include Web3Auth client ID
- Update Connect components to remove Firebase SFA flow
* docs: add Web3Auth wallet provider documentation
Document the Web3Auth provider in the getting-started guides, including:
- Installation instructions for required dependencies: @web3auth/modal,
@web3auth/base, and @web3auth/base-provider
- Configuration options for the modal-based authentication flow
- Optional parameters: web3AuthNetwork, loginProvider, uiConfig
- Custom Authentication section explaining Single Factor Auth (SFA)
approach with note about additional @web3auth/single-factor-auth
dependency
- Links to Web3Auth dashboard and documentation
* style(examples): fix Prettier formatting
Apply Prettier formatting fixes to resolve CI failures.
- Remove trailing blank lines from CSS files
- Collapse Vue template attributes to single line where appropriate
* chore(webpack): add Web3Auth packages to webpack fallback
Add missing Web3Auth peer dependencies to the webpack fallback
configuration to prevent build errors when these optional packages
are not installed.
- `@web3auth/base`
- `@web3auth/base-provider`
- `@web3auth/modal`
- `@web3auth/single-factor-auth`
---------
Co-authored-by: Doug Richar <drichar@gmail.com>1 parent 3306f97 commit 88dedbd
File tree
53 files changed
+3977
-230
lines changed- docs/getting-started
- examples
- nextjs
- src/app
- nuxt
- components
- plugins
- react-ts
- src
- solid-ts
- src
- svelte-ts
- src
- lib/components
- routes
- vanilla-ts
- src
- vue-ts
- src
- components
- packages
- use-wallet-react
- use-wallet
- src
- __tests__
- wallets
- wallets
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
53 files changed
+3977
-230
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
370 | 398 | | |
371 | 399 | | |
372 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
189 | 241 | | |
190 | 242 | | |
191 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | | - | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | | - | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
0 commit comments