@lumiapassport/ui-kit 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +179 -54
- package/dist/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,43 +13,57 @@ React UI components and hooks for Lumia Passport - a secure, user-friendly authe
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install @lumiapassport/ui-kit
|
|
16
|
+
npm install @lumiapassport/ui-kit
|
|
17
17
|
# or
|
|
18
|
-
pnpm add @lumiapassport/ui-kit
|
|
18
|
+
pnpm add @lumiapassport/ui-kit
|
|
19
19
|
# or
|
|
20
|
-
yarn add @lumiapassport/ui-kit
|
|
20
|
+
yarn add @lumiapassport/ui-kit
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
## Quick Start
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### 1. Setup QueryClient (Required)
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
npm install react react-dom viem wagmi @tanstack/react-query
|
|
29
|
-
```
|
|
27
|
+
The UI Kit requires `@tanstack/react-query` for state management. First, create a query client:
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
```tsx
|
|
30
|
+
// queryClient.ts
|
|
31
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
32
|
+
|
|
33
|
+
export const queryClient = new QueryClient({
|
|
34
|
+
defaultOptions: {
|
|
35
|
+
queries: {
|
|
36
|
+
staleTime: 1000 * 60 * 5, // 5 minutes
|
|
37
|
+
gcTime: 1000 * 60 * 10, // 10 minutes
|
|
38
|
+
refetchOnWindowFocus: false,
|
|
39
|
+
retry: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
32
44
|
|
|
33
|
-
###
|
|
45
|
+
### 2. Wrap your app with providers
|
|
34
46
|
|
|
35
47
|
```tsx
|
|
48
|
+
import { QueryClientProvider } from '@tanstack/react-query';
|
|
36
49
|
import { LumiaPassportProvider } from '@lumiapassport/ui-kit';
|
|
37
50
|
import '@lumiapassport/ui-kit/dist/styles.css';
|
|
51
|
+
import { queryClient } from './queryClient';
|
|
38
52
|
|
|
39
|
-
function
|
|
53
|
+
function Root() {
|
|
40
54
|
return (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
projectId
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</
|
|
55
|
+
<QueryClientProvider client={queryClient}>
|
|
56
|
+
<LumiaPassportProvider
|
|
57
|
+
projectId="your-project-id" // Get from Lumia Passport Dashboard
|
|
58
|
+
>
|
|
59
|
+
<YourApp />
|
|
60
|
+
</LumiaPassportProvider>
|
|
61
|
+
</QueryClientProvider>
|
|
48
62
|
);
|
|
49
63
|
}
|
|
50
64
|
```
|
|
51
65
|
|
|
52
|
-
###
|
|
66
|
+
### 3. Add the Connect Button
|
|
53
67
|
|
|
54
68
|
```tsx
|
|
55
69
|
import { ConnectWalletButton } from '@lumiapassport/ui-kit';
|
|
@@ -58,7 +72,7 @@ function YourApp() {
|
|
|
58
72
|
return (
|
|
59
73
|
<div>
|
|
60
74
|
<h1>My App</h1>
|
|
61
|
-
<ConnectWalletButton />
|
|
75
|
+
<ConnectWalletButton label="Sign in" mode="compact"/>
|
|
62
76
|
</div>
|
|
63
77
|
);
|
|
64
78
|
}
|
|
@@ -66,22 +80,24 @@ function YourApp() {
|
|
|
66
80
|
|
|
67
81
|
That's it! The `ConnectWalletButton` provides a complete authentication UI with wallet management.
|
|
68
82
|
|
|
83
|
+
> **Note:** Don't forget to wrap your app with `QueryClientProvider` from `@tanstack/react-query` before using `LumiaPassportProvider`, otherwise you'll get an error: "No QueryClient set, use QueryClientProvider to set one"
|
|
84
|
+
|
|
69
85
|
## Configuration Options
|
|
70
86
|
|
|
71
87
|
### Basic Configuration
|
|
72
88
|
|
|
73
89
|
```tsx
|
|
74
90
|
<LumiaPassportProvider
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
projectId="your-project-id" // Required
|
|
92
|
+
initialConfig={{
|
|
93
|
+
network: {
|
|
94
|
+
name: 'Lumia Beam',
|
|
95
|
+
symbol: 'LUMIA',
|
|
96
|
+
chainId: 2030232745,
|
|
97
|
+
rpcUrl: 'https://beam-rpc.lumia.org',
|
|
98
|
+
explorerUrl: 'https://beam-explorer.lumia.org',
|
|
99
|
+
testnet: true,
|
|
100
|
+
},
|
|
85
101
|
}}
|
|
86
102
|
>
|
|
87
103
|
```
|
|
@@ -90,27 +106,134 @@ That's it! The `ConnectWalletButton` provides a complete authentication UI with
|
|
|
90
106
|
|
|
91
107
|
```tsx
|
|
92
108
|
<LumiaPassportProvider
|
|
93
|
-
|
|
94
|
-
|
|
109
|
+
projectId="your-project-id"
|
|
110
|
+
initialConfig={{
|
|
111
|
+
// UI customization
|
|
112
|
+
ui: {
|
|
113
|
+
theme: 'dark', // 'light' | 'dark' | 'auto'
|
|
114
|
+
title: 'Welcome to MyApp',
|
|
115
|
+
subtitle: 'Sign in to continue',
|
|
116
|
+
authOrder: ['email', 'passkey', 'social'],
|
|
117
|
+
modal: {
|
|
118
|
+
width: '420px',
|
|
119
|
+
borderRadius: '24px'
|
|
120
|
+
},
|
|
121
|
+
branding: {
|
|
122
|
+
tagline: 'Powered by MPC',
|
|
123
|
+
link: { text: 'Learn More', url: 'https://example.com/docs' },
|
|
124
|
+
},
|
|
125
|
+
// Custom colors
|
|
126
|
+
colors: {
|
|
127
|
+
dark: {
|
|
128
|
+
background: '#060117',
|
|
129
|
+
text: '#fefdff',
|
|
130
|
+
textSecondary: '#c4c2c7',
|
|
131
|
+
textMuted: '#8a8890',
|
|
132
|
+
border: '#2a1a3a',
|
|
133
|
+
buttonBackground: '#ff6b35',
|
|
134
|
+
buttonBackgroundEnd: '#f7931e',
|
|
135
|
+
buttonText: '#ffffff',
|
|
136
|
+
buttonBackgroundHover: '#e55a2b',
|
|
137
|
+
buttonBackgroundHoverEnd: '#d67d1a',
|
|
138
|
+
connectedButtonBackground: 'rgba(27, 90, 226, 0.6)',
|
|
139
|
+
connectedButtonBorder: '#4a5568'
|
|
140
|
+
},
|
|
141
|
+
light: {
|
|
142
|
+
background: '#fefdff',
|
|
143
|
+
text: '#060117',
|
|
144
|
+
textSecondary: '#4a4754',
|
|
145
|
+
textMuted: '#6b6a70',
|
|
146
|
+
border: '#e0dde6',
|
|
147
|
+
buttonBackground: '#9333ea',
|
|
148
|
+
buttonBackgroundEnd: '#2563eb',
|
|
149
|
+
buttonText: '#fefdff',
|
|
150
|
+
buttonBackgroundHover: '#7e22ce',
|
|
151
|
+
buttonBackgroundHoverEnd: '#1d4ed8',
|
|
152
|
+
connectedButtonBackground: '#f3f4f6',
|
|
153
|
+
connectedButtonBorder: '#d1d5db'
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
},
|
|
95
157
|
|
|
96
158
|
// Authentication providers
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
159
|
+
email: {
|
|
160
|
+
enabled: true,
|
|
161
|
+
placeholder: 'Enter your email',
|
|
162
|
+
buttonText: 'Continue',
|
|
163
|
+
verificationTitle: 'Check your email',
|
|
102
164
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
165
|
+
passkey: {
|
|
166
|
+
enabled: true,
|
|
167
|
+
showCreateButton: true,
|
|
168
|
+
primaryButtonText: 'Sign in with Passkey',
|
|
169
|
+
},
|
|
170
|
+
social: {
|
|
171
|
+
enabled: true,
|
|
172
|
+
gridColumns: 2,
|
|
173
|
+
providers: [
|
|
174
|
+
{ id: 'Discord', name: 'Discord', enabled: true, comingSoon: false },
|
|
175
|
+
{ id: 'telegram', name: 'Telegram', enabled: true, comingSoon: false },
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
wallet: {
|
|
179
|
+
enabled: true,
|
|
180
|
+
supportedChains: [994873017, 2030232745],
|
|
181
|
+
requireSignature: true,
|
|
182
|
+
walletConnectProjectId: 'your-walletconnect-id',
|
|
108
183
|
},
|
|
109
184
|
|
|
110
185
|
// Features
|
|
111
186
|
features: {
|
|
112
|
-
|
|
113
|
-
|
|
187
|
+
mpcSecurity: true,
|
|
188
|
+
strictMode: false,
|
|
189
|
+
requestDeduplication: true,
|
|
190
|
+
kycNeeded: false,
|
|
191
|
+
displayNameNeeded: false,
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
// KYC configuration (if needed)
|
|
195
|
+
kyc: {
|
|
196
|
+
provider: 'sumsub',
|
|
197
|
+
options: { levelName: 'basic-kyc', flowName: 'default' }
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
// Warnings
|
|
201
|
+
warnings: {
|
|
202
|
+
backupWarning: true,
|
|
203
|
+
emailNotConnectedWarning: true,
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
// Network configuration
|
|
207
|
+
network: {
|
|
208
|
+
name: 'Lumia Beam',
|
|
209
|
+
symbol: 'LUMIA',
|
|
210
|
+
chainId: 2030232745,
|
|
211
|
+
rpcUrl: 'https://beam-rpc.lumia.org',
|
|
212
|
+
explorerUrl: 'https://beam-explorer.lumia.org',
|
|
213
|
+
testnet: true,
|
|
214
|
+
},
|
|
215
|
+
}}
|
|
216
|
+
callbacks={{
|
|
217
|
+
onLumiaPassportConnecting: ({ method, provider }) => {
|
|
218
|
+
console.log('Connecting with:', method, provider);
|
|
219
|
+
},
|
|
220
|
+
onLumiaPassportConnect: ({ address, session }) => {
|
|
221
|
+
console.log('Connected:', address);
|
|
222
|
+
},
|
|
223
|
+
onLumiaPassportAccount: ({ userId, address, session, hasKeyshare }) => {
|
|
224
|
+
console.log('Account ready:', userId);
|
|
225
|
+
},
|
|
226
|
+
onLumiaPassportUpdate: ({ providers }) => {
|
|
227
|
+
console.log('Profile updated:', providers);
|
|
228
|
+
},
|
|
229
|
+
onLumiaPassportDisconnect: ({ address, userId }) => {
|
|
230
|
+
console.log('Disconnected:', address);
|
|
231
|
+
},
|
|
232
|
+
onLumiaPassportError: ({ error, message }) => {
|
|
233
|
+
console.error('Error:', message);
|
|
234
|
+
},
|
|
235
|
+
onWalletReady: (status) => {
|
|
236
|
+
console.log('Wallet ready:', status.ready);
|
|
114
237
|
},
|
|
115
238
|
}}
|
|
116
239
|
>
|
|
@@ -348,12 +471,14 @@ Secure biometric authentication with device passkeys.
|
|
|
348
471
|
Authentication via Telegram for mini apps.
|
|
349
472
|
|
|
350
473
|
```tsx
|
|
351
|
-
//
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
474
|
+
// Configure via social providers:
|
|
475
|
+
initialConfig={{
|
|
476
|
+
social: {
|
|
477
|
+
enabled: true,
|
|
478
|
+
providers: [
|
|
479
|
+
{ id: 'telegram', name: 'Telegram', enabled: true },
|
|
480
|
+
],
|
|
481
|
+
},
|
|
357
482
|
}}
|
|
358
483
|
```
|
|
359
484
|
|
|
@@ -374,10 +499,10 @@ Connect existing wallets (MetaMask, WalletConnect, etc.).
|
|
|
374
499
|
import '@lumiapassport/ui-kit/dist/styles.css';
|
|
375
500
|
|
|
376
501
|
<LumiaPassportProvider
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
502
|
+
projectId="your-project-id"
|
|
503
|
+
initialConfig={{
|
|
504
|
+
ui: {
|
|
505
|
+
theme: 'dark', // or 'light', 'auto'
|
|
381
506
|
}
|
|
382
507
|
}}
|
|
383
508
|
>
|
package/dist/iframe/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<meta http-equiv="X-Content-Type-Options" content="nosniff" />
|
|
16
16
|
<meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
|
|
17
17
|
|
|
18
|
-
<title>Lumia Passport Secure Wallet - iframe version 1.5.
|
|
18
|
+
<title>Lumia Passport Secure Wallet - iframe version 1.5.2</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -8516,7 +8516,7 @@ function useLumiaPassportLinkedProfiles() {
|
|
|
8516
8516
|
// package.json
|
|
8517
8517
|
var package_default = {
|
|
8518
8518
|
name: "@lumiapassport/ui-kit",
|
|
8519
|
-
version: "1.5.
|
|
8519
|
+
version: "1.5.2",
|
|
8520
8520
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
8521
8521
|
type: "module",
|
|
8522
8522
|
main: "./dist/index.cjs",
|