@taskon/widget-react 0.0.1 → 0.0.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 +118 -64
- package/dist/CommunityTaskList.css +2694 -2951
- package/dist/EligibilityInfo.css +2221 -1332
- package/dist/LeaderboardWidget.css +403 -198
- package/dist/PageBuilder.css +57 -0
- package/dist/Quest.css +1347 -1477
- package/dist/TaskOnProvider.css +337 -29
- package/dist/ThemeProvider.css +228 -0
- package/dist/UserCenterWidget.css +168 -0
- package/dist/UserCenterWidget2.css +4917 -0
- package/dist/WidgetShell.css +417 -130
- package/dist/chunks/{CommunityTaskList-CrH6r4Av.js → CommunityTaskList-2nFy6l6m.js} +2612 -2074
- package/dist/chunks/{EligibilityInfo-DesW9-k9.js → EligibilityInfo-CKTl_cdU.js} +2714 -4077
- package/dist/chunks/{LeaderboardWidget-BSGpHKTk.js → LeaderboardWidget-DyoiiNS6.js} +288 -349
- package/dist/chunks/PageBuilder-DHM3Il6f.js +150 -0
- package/dist/chunks/{Quest-uSIVq78I.js → Quest-Dqx4OCat.js} +1380 -726
- package/dist/chunks/TaskOnProvider-CxtFIs3n.js +2072 -0
- package/dist/chunks/{WidgetShell-NlOgn1x5.js → ThemeProvider-CulHkqqY.js} +1397 -103
- package/dist/chunks/UserCenterWidget-SE5hqpnZ.js +8335 -0
- package/dist/chunks/UserCenterWidget-XL6LZRZM.js +3259 -0
- package/dist/chunks/{Table-CWGf2FKV.js → WidgetShell-8xn-Jivw.js} +237 -27
- package/dist/chunks/communitytask-es-CBNnS4o2.js +521 -0
- package/dist/chunks/communitytask-ja-GRf9cbdx.js +521 -0
- package/dist/chunks/communitytask-ko-Bf24PQKI.js +521 -0
- package/dist/chunks/communitytask-ru-CZm2CPoV.js +521 -0
- package/dist/chunks/leaderboardwidget-es-vKjrjQaz.js +146 -0
- package/dist/chunks/leaderboardwidget-ja-Q6u0HxKG.js +146 -0
- package/dist/chunks/leaderboardwidget-ko-CG6SWgxf.js +146 -0
- package/dist/chunks/leaderboardwidget-ru-DCcHcJGz.js +146 -0
- package/dist/chunks/quest-es-Dyyy0zaw.js +863 -0
- package/dist/chunks/quest-ja-Depog33y.js +863 -0
- package/dist/chunks/quest-ko-BMu3uRQJ.js +863 -0
- package/dist/chunks/quest-ru-xne814Rw.js +863 -0
- package/dist/chunks/taskwidget-es-Do9b3Mqw.js +245 -0
- package/dist/chunks/taskwidget-ja-CqSu-yWA.js +245 -0
- package/dist/chunks/taskwidget-ko-EHgXFV4B.js +245 -0
- package/dist/chunks/taskwidget-ru-CMbLQDK4.js +245 -0
- package/dist/chunks/useIsMobile-D6Ybur-6.js +30 -0
- package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
- package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
- package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
- package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
- package/dist/community-task.d.ts +29 -388
- package/dist/community-task.js +2 -7
- package/dist/core.d.ts +95 -28
- package/dist/core.js +11 -12
- package/dist/index.d.ts +260 -602
- package/dist/index.js +28 -7361
- package/dist/leaderboard.d.ts +5 -496
- package/dist/leaderboard.js +2 -15
- package/dist/page-builder.d.ts +20 -0
- package/dist/page-builder.js +4 -0
- package/dist/quest.d.ts +20 -292
- package/dist/quest.js +2 -5
- package/dist/user-center.d.ts +56 -0
- package/dist/user-center.js +4 -0
- package/package.json +22 -3
- package/dist/Table.css +0 -389
- package/dist/chunks/TaskOnProvider-QMwxGL44.js +0 -1435
- package/dist/chunks/ThemeProvider-Cs8IUVQj.js +0 -1118
- package/dist/chunks/leaderboardwidget-ja-Bj6gz6y1.js +0 -119
- package/dist/chunks/leaderboardwidget-ko-f1cLO9ic.js +0 -119
- package/dist/chunks/useWidgetLocale-BVcopbZS.js +0 -74
- package/dist/chunks/usercenter-ja-DBj_dtuz.js +0 -329
- package/dist/chunks/usercenter-ko-DYTkHAld.js +0 -329
- package/dist/index.css +0 -3662
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ import { QuestWidget } from "@taskon/widget-react/quest";
|
|
|
23
23
|
const App = () => (
|
|
24
24
|
<TaskOnProvider
|
|
25
25
|
config={{
|
|
26
|
-
|
|
26
|
+
clientId: "your-client-id",
|
|
27
27
|
}}
|
|
28
28
|
>
|
|
29
29
|
<YourApp />
|
|
@@ -43,6 +43,7 @@ import { TaskOnProvider, ThemeProvider, useTaskOnAuth } from "@taskon/widget-rea
|
|
|
43
43
|
import { QuestWidget } from "@taskon/widget-react/quest"; // ~26KB CSS
|
|
44
44
|
import { CommunityTaskList } from "@taskon/widget-react/community-task"; // ~51KB CSS
|
|
45
45
|
import { LeaderboardWidget } from "@taskon/widget-react/leaderboard"; // ~17KB CSS
|
|
46
|
+
import { UserCenterWidget } from "@taskon/widget-react/user-center"; // UserCenter CSS only
|
|
46
47
|
```
|
|
47
48
|
|
|
48
49
|
### Alternative: Main Entry Import (Loads All CSS)
|
|
@@ -61,7 +62,7 @@ import { QuestWidget } from "@taskon/widget-react/quest";
|
|
|
61
62
|
const App = () => (
|
|
62
63
|
<TaskOnProvider
|
|
63
64
|
config={{
|
|
64
|
-
|
|
65
|
+
clientId: "your-client-id",
|
|
65
66
|
}}
|
|
66
67
|
>
|
|
67
68
|
<YourApp />
|
|
@@ -92,7 +93,7 @@ const YourApp = () => {
|
|
|
92
93
|
<div>
|
|
93
94
|
{userId && <p>TaskOn User ID: {userId}</p>}
|
|
94
95
|
{/* Theme configured in TaskOn Dashboard */}
|
|
95
|
-
<QuestWidget
|
|
96
|
+
<QuestWidget widgetId={123} />
|
|
96
97
|
</div>
|
|
97
98
|
);
|
|
98
99
|
};
|
|
@@ -102,17 +103,17 @@ const YourApp = () => {
|
|
|
102
103
|
|
|
103
104
|
```
|
|
104
105
|
┌─ TaskOnProvider ─────────────────────────────────────────┐
|
|
105
|
-
│ config: {
|
|
106
|
+
│ config: { clientId } │
|
|
106
107
|
│ Purpose: Authentication only │
|
|
107
108
|
│ │
|
|
108
109
|
│ ┌─ Mode A: Cloud Config ──────────────────────────────┐ │
|
|
109
|
-
│ │ <QuestWidget
|
|
110
|
+
│ │ <QuestWidget widgetId={123} /> │ │
|
|
110
111
|
│ │ → Theme from TaskOn cloud │ │
|
|
111
112
|
│ └─────────────────────────────────────────────────────┘ │
|
|
112
113
|
│ │
|
|
113
114
|
│ ┌─ Mode B: Local Theme ───────────────────────────────┐ │
|
|
114
115
|
│ │ <ThemeProvider theme={{ mode: 'dark' }}> │ │
|
|
115
|
-
│ │ <QuestWidget /> /* no
|
|
116
|
+
│ │ <QuestWidget /> /* no widgetId */ │ │
|
|
116
117
|
│ │ </ThemeProvider> │ │
|
|
117
118
|
│ └─────────────────────────────────────────────────────┘ │
|
|
118
119
|
└──────────────────────────────────────────────────────────┘
|
|
@@ -122,17 +123,17 @@ const YourApp = () => {
|
|
|
122
123
|
|
|
123
124
|
| Mode | Theme Source |
|
|
124
125
|
| --------------------- | ------------------------------------ |
|
|
125
|
-
| `
|
|
126
|
-
| No `
|
|
126
|
+
| `widgetId` provided | Cloud config (ThemeProvider ignored) |
|
|
127
|
+
| No `widgetId` | ThemeProvider or default theme |
|
|
127
128
|
|
|
128
129
|
## Security
|
|
129
130
|
|
|
130
|
-
TaskOn uses **
|
|
131
|
+
TaskOn uses **Client ID** authentication to verify that widget requests come from authorized projects.
|
|
131
132
|
|
|
132
|
-
### Step 1: Get
|
|
133
|
+
### Step 1: Get Client ID from TaskOn Dashboard
|
|
133
134
|
|
|
134
135
|
```
|
|
135
|
-
|
|
136
|
+
Client ID: /KDiqEFNCaGTVTdTpCFrZOsUj5vDi5uGLSFmwyHeboE= (for X-API-Key header)
|
|
136
137
|
```
|
|
137
138
|
|
|
138
139
|
### Step 2: Configure TaskOnProvider
|
|
@@ -140,7 +141,7 @@ API Key: /KDiqEFNCaGTVTdTpCFrZOsUj5vDi5uGLSFmwyHeboE= (for X-API-Key header)
|
|
|
140
141
|
```tsx
|
|
141
142
|
<TaskOnProvider
|
|
142
143
|
config={{
|
|
143
|
-
|
|
144
|
+
clientId: "your-client-id",
|
|
144
145
|
}}
|
|
145
146
|
>
|
|
146
147
|
<YourApp />
|
|
@@ -152,13 +153,13 @@ API Key: /KDiqEFNCaGTVTdTpCFrZOsUj5vDi5uGLSFmwyHeboE= (for X-API-Key header)
|
|
|
152
153
|
All API requests include:
|
|
153
154
|
|
|
154
155
|
```
|
|
155
|
-
X-API-Key: your-
|
|
156
|
+
X-API-Key: your-client-id # Project authorization
|
|
156
157
|
Authorization: Bearer xxx # User authorization (after login)
|
|
157
158
|
```
|
|
158
159
|
|
|
159
160
|
### Security Best Practices
|
|
160
161
|
|
|
161
|
-
1. **Keep
|
|
162
|
+
1. **Keep Client ID secure** - Don't expose in public repositories
|
|
162
163
|
2. **Use HTTPS** - All communication must be encrypted
|
|
163
164
|
|
|
164
165
|
## TaskOnProvider
|
|
@@ -176,8 +177,8 @@ The root provider component for authentication. Must wrap your application.
|
|
|
176
177
|
|
|
177
178
|
```typescript
|
|
178
179
|
interface TaskOnProviderConfig {
|
|
179
|
-
// Required:
|
|
180
|
-
|
|
180
|
+
// Required: Client ID for authentication (X-API-Key header)
|
|
181
|
+
clientId: string;
|
|
181
182
|
|
|
182
183
|
// Locale setting
|
|
183
184
|
locale?: "en" | "ko" | "ja" | "ru" | "es"; // default: auto-detect
|
|
@@ -186,10 +187,13 @@ interface TaskOnProviderConfig {
|
|
|
186
187
|
walletConfig?: {
|
|
187
188
|
evmAdapter?: WalletAdapter; // Custom EVM wallet adapter
|
|
188
189
|
solanaAdapter?: WalletAdapter; // Custom Solana wallet adapter
|
|
189
|
-
disableAutoDetect?: boolean; // Disable auto-detection
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
// WalletConnect Project ID
|
|
192
|
+
// WalletConnect Project ID
|
|
193
|
+
// Only needed when you design Web3 wallet login or wallet-based rewards
|
|
194
|
+
// (wallet binding, on-chain verification, NFT/token claiming, etc.)
|
|
195
|
+
// Optional; SDK has a built-in default project ID
|
|
196
|
+
// For production, strongly recommended to use your own project ID
|
|
193
197
|
// Get your project ID at https://cloud.walletconnect.com
|
|
194
198
|
walletConnectProjectId?: string;
|
|
195
199
|
|
|
@@ -215,7 +219,7 @@ interface TaskOnProviderConfig {
|
|
|
215
219
|
```tsx
|
|
216
220
|
<TaskOnProvider
|
|
217
221
|
config={{
|
|
218
|
-
|
|
222
|
+
clientId: "your-client-id",
|
|
219
223
|
locale: "ko",
|
|
220
224
|
}}
|
|
221
225
|
>
|
|
@@ -232,13 +236,13 @@ const App = () => {
|
|
|
232
236
|
const [locale, setLocale] = useState("en");
|
|
233
237
|
|
|
234
238
|
return (
|
|
235
|
-
<TaskOnProvider config={{
|
|
239
|
+
<TaskOnProvider config={{ clientId: "your-client-id", locale }}>
|
|
236
240
|
<select value={locale} onChange={(e) => setLocale(e.target.value)}>
|
|
237
241
|
<option value="en">English</option>
|
|
238
242
|
<option value="ko">한국어</option>
|
|
239
243
|
<option value="ja">日本語</option>
|
|
240
244
|
</select>
|
|
241
|
-
<QuestWidget
|
|
245
|
+
<QuestWidget widgetId={123} />
|
|
242
246
|
</TaskOnProvider>
|
|
243
247
|
);
|
|
244
248
|
};
|
|
@@ -265,7 +269,10 @@ Optional provider for theme configuration. Supports nesting for different theme
|
|
|
265
269
|
```typescript
|
|
266
270
|
interface TaskOnThemeConfig {
|
|
267
271
|
// Theme mode
|
|
268
|
-
mode?: "light" | "dark" | "auto"; // default: '
|
|
272
|
+
mode?: "light" | "dark" | "auto"; // default: 'dark'
|
|
273
|
+
|
|
274
|
+
// Theme mode strategy (mainly for cloud dual mode)
|
|
275
|
+
modeStrategy?: "auto" | "toggle"; // default: 'auto'
|
|
269
276
|
|
|
270
277
|
// Compact mode
|
|
271
278
|
compact?: boolean; // default: false
|
|
@@ -315,6 +322,8 @@ interface MapToken {
|
|
|
315
322
|
colorTextSecondary?: string;
|
|
316
323
|
colorTextTertiary?: string;
|
|
317
324
|
colorTextDisabled?: string;
|
|
325
|
+
colorLink?: string;
|
|
326
|
+
colorTextOnPrimary?: string;
|
|
318
327
|
|
|
319
328
|
// Border
|
|
320
329
|
colorBorder?: string;
|
|
@@ -340,6 +349,28 @@ interface MapToken {
|
|
|
340
349
|
}
|
|
341
350
|
```
|
|
342
351
|
|
|
352
|
+
### themeMode Override
|
|
353
|
+
|
|
354
|
+
SDK can control theme mode per widget using `themeMode`:
|
|
355
|
+
|
|
356
|
+
```tsx
|
|
357
|
+
<QuestWidget widgetId={123} themeMode="light" />
|
|
358
|
+
<QuestWidget widgetId={123} themeMode="dark" />
|
|
359
|
+
<QuestWidget widgetId={123} themeMode="auto" />
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
`themeMode` is supported by:
|
|
363
|
+
|
|
364
|
+
- `QuestWidget`
|
|
365
|
+
- `CommunityTaskList`
|
|
366
|
+
- `LeaderboardWidget`
|
|
367
|
+
- `UserCenterWidget`
|
|
368
|
+
|
|
369
|
+
Priority rule:
|
|
370
|
+
|
|
371
|
+
- `themeMode` (widget prop) has the highest priority when provided.
|
|
372
|
+
- Recommended usage: `dual + toggle` in B-end for clearer mode ownership.
|
|
373
|
+
|
|
343
374
|
### Token Priority
|
|
344
375
|
|
|
345
376
|
```
|
|
@@ -351,7 +382,7 @@ light/dark.map > light/dark.seed (derived) > map > seed (derived) > default
|
|
|
351
382
|
Nested ThemeProviders inherit from parent and can override specific values:
|
|
352
383
|
|
|
353
384
|
```tsx
|
|
354
|
-
<TaskOnProvider config={{
|
|
385
|
+
<TaskOnProvider config={{ clientId: "your-client-id" }}>
|
|
355
386
|
<ThemeProvider theme={{ mode: "light", seed: { colorPrimary: "#6366f1" } }}>
|
|
356
387
|
<Header /> {/* light + primary #6366f1 */}
|
|
357
388
|
<ThemeProvider theme={{ mode: "dark" }}>
|
|
@@ -416,19 +447,23 @@ Use `inherit={false}` for completely independent themes:
|
|
|
416
447
|
|
|
417
448
|
### Cloud Configuration
|
|
418
449
|
|
|
419
|
-
Widgets support cloud configuration via `
|
|
450
|
+
Widgets support cloud configuration via `widgetId`. Configure in TaskOn Dashboard and load at runtime:
|
|
420
451
|
|
|
421
452
|
```tsx
|
|
422
453
|
// Cloud config includes: theme, feature flags, custom texts
|
|
423
|
-
<QuestWidget
|
|
454
|
+
<QuestWidget widgetId={123} />
|
|
424
455
|
```
|
|
425
456
|
|
|
426
457
|
### Widget Props
|
|
427
458
|
|
|
428
459
|
```typescript
|
|
429
460
|
interface WidgetProps {
|
|
430
|
-
// Cloud
|
|
431
|
-
|
|
461
|
+
// Cloud widget ID from TaskOn Dashboard
|
|
462
|
+
widgetId?: number;
|
|
463
|
+
|
|
464
|
+
// Manual theme mode override (highest priority when provided)
|
|
465
|
+
// Recommended usage: pair with cloud dual+toggle for clearer ownership
|
|
466
|
+
themeMode?: "light" | "dark" | "auto";
|
|
432
467
|
|
|
433
468
|
// Custom class names for widget parts
|
|
434
469
|
classNames?: {
|
|
@@ -457,7 +492,7 @@ Widgets support fine-grained styling via `classNames` and `styles` props:
|
|
|
457
492
|
```tsx
|
|
458
493
|
// Using classNames
|
|
459
494
|
<QuestWidget
|
|
460
|
-
|
|
495
|
+
widgetId={123}
|
|
461
496
|
classNames={{
|
|
462
497
|
root: 'my-quest-widget',
|
|
463
498
|
header: 'my-quest-header',
|
|
@@ -467,7 +502,7 @@ Widgets support fine-grained styling via `classNames` and `styles` props:
|
|
|
467
502
|
|
|
468
503
|
// Using inline styles
|
|
469
504
|
<QuestWidget
|
|
470
|
-
|
|
505
|
+
widgetId={123}
|
|
471
506
|
styles={{
|
|
472
507
|
root: { maxWidth: 400 },
|
|
473
508
|
header: { borderBottom: '1px solid #eee' },
|
|
@@ -477,7 +512,7 @@ Widgets support fine-grained styling via `classNames` and `styles` props:
|
|
|
477
512
|
|
|
478
513
|
// Combining both
|
|
479
514
|
<QuestWidget
|
|
480
|
-
|
|
515
|
+
widgetId={123}
|
|
481
516
|
classNames={{ root: 'custom-widget' }}
|
|
482
517
|
styles={{ header: { backgroundColor: 'transparent' } }}
|
|
483
518
|
/>
|
|
@@ -489,13 +524,13 @@ Each widget documents its available parts in its own API reference.
|
|
|
489
524
|
|
|
490
525
|
```tsx
|
|
491
526
|
// Example 1: Using cloud config (theme from Dashboard)
|
|
492
|
-
<TaskOnProvider config={{
|
|
493
|
-
<QuestWidget
|
|
494
|
-
<TaskWidget
|
|
527
|
+
<TaskOnProvider config={{ clientId: 'your-client-id' }}>
|
|
528
|
+
<QuestWidget widgetId={123} />
|
|
529
|
+
<TaskWidget widgetId={456} />
|
|
495
530
|
</TaskOnProvider>
|
|
496
531
|
|
|
497
532
|
// Example 2: Using local theme (no cloud config)
|
|
498
|
-
<TaskOnProvider config={{
|
|
533
|
+
<TaskOnProvider config={{ clientId: 'your-client-id' }}>
|
|
499
534
|
<ThemeProvider theme={{ mode: 'dark', seed: { colorPrimary: '#6366f1' } }}>
|
|
500
535
|
<QuestWidget />
|
|
501
536
|
<TaskWidget />
|
|
@@ -503,7 +538,7 @@ Each widget documents its available parts in its own API reference.
|
|
|
503
538
|
</TaskOnProvider>
|
|
504
539
|
|
|
505
540
|
// Example 3: Different local themes for different areas
|
|
506
|
-
<TaskOnProvider config={{
|
|
541
|
+
<TaskOnProvider config={{ clientId: 'your-client-id' }}>
|
|
507
542
|
<ThemeProvider theme={{ mode: 'light' }}>
|
|
508
543
|
<TaskWidget />
|
|
509
544
|
</ThemeProvider>
|
|
@@ -514,9 +549,9 @@ Each widget documents its available parts in its own API reference.
|
|
|
514
549
|
</TaskOnProvider>
|
|
515
550
|
|
|
516
551
|
// Example 4: Mixed - some with cloud config, some with local theme
|
|
517
|
-
<TaskOnProvider config={{
|
|
552
|
+
<TaskOnProvider config={{ clientId: 'your-client-id' }}>
|
|
518
553
|
{/* Cloud config */}
|
|
519
|
-
<QuestWidget
|
|
554
|
+
<QuestWidget widgetId={123} />
|
|
520
555
|
|
|
521
556
|
{/* Local theme */}
|
|
522
557
|
<ThemeProvider theme={{ mode: 'dark' }}>
|
|
@@ -594,34 +629,44 @@ TaskOn provides flexible wallet integration options:
|
|
|
594
629
|
| Setup | Behavior |
|
|
595
630
|
| -------------- | ------------------------------------- |
|
|
596
631
|
| Custom adapter | Uses your provided `WalletAdapter` |
|
|
597
|
-
| Default | Uses built-in
|
|
632
|
+
| Default | Uses built-in wallet picker adapter |
|
|
598
633
|
|
|
599
634
|
### Custom Wallet Adapter (Recommended)
|
|
600
635
|
|
|
601
636
|
If you want full control over wallet connection (e.g., using RainbowKit, Web3Modal), provide a custom adapter:
|
|
602
637
|
|
|
603
638
|
```tsx
|
|
639
|
+
import { useMemo } from "react";
|
|
604
640
|
import { createWalletAdapter } from "./my-wallet-adapter";
|
|
605
641
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
642
|
+
const App = () => {
|
|
643
|
+
const evmAdapter = useMemo(() => createWalletAdapter(), []);
|
|
644
|
+
|
|
645
|
+
return (
|
|
646
|
+
<TaskOnProvider
|
|
647
|
+
config={{
|
|
648
|
+
clientId: "your-client-id",
|
|
649
|
+
walletConfig: {
|
|
650
|
+
evmAdapter,
|
|
651
|
+
},
|
|
652
|
+
}}
|
|
653
|
+
>
|
|
654
|
+
<MainContent />
|
|
655
|
+
</TaskOnProvider>
|
|
656
|
+
);
|
|
657
|
+
};
|
|
616
658
|
```
|
|
617
659
|
|
|
660
|
+
Note: keep `evmAdapter` reference stable (for example via `useMemo`) to avoid
|
|
661
|
+
re-creating adapters and resetting wallet state on every render.
|
|
662
|
+
|
|
618
663
|
### Built-in Wallet Support
|
|
619
664
|
|
|
620
|
-
If no custom adapter is provided, TaskOn automatically uses
|
|
665
|
+
If no custom adapter is provided, TaskOn automatically uses built-in wallet picker flow:
|
|
621
666
|
|
|
622
667
|
```tsx
|
|
623
|
-
// No wallet config needed
|
|
624
|
-
<TaskOnProvider config={{
|
|
668
|
+
// No wallet config needed
|
|
669
|
+
<TaskOnProvider config={{ clientId: "your-client-id" }}>
|
|
625
670
|
<App />
|
|
626
671
|
</TaskOnProvider>
|
|
627
672
|
```
|
|
@@ -632,23 +677,25 @@ When tasks require wallet binding (e.g., on-chain verification), TaskOn shows a
|
|
|
632
677
|
|
|
633
678
|
**Desktop (without adapter):**
|
|
634
679
|
- MetaMask
|
|
635
|
-
- ONTO Wallet
|
|
636
680
|
- Bitget Wallet
|
|
637
681
|
- OKX Wallet
|
|
638
|
-
- WalletConnect (
|
|
682
|
+
- WalletConnect (uses SDK default project ID if not configured; not recommended for production)
|
|
639
683
|
|
|
640
684
|
**Mobile (non-Dapp browser):**
|
|
641
|
-
- WalletConnect only (
|
|
685
|
+
- WalletConnect only (uses SDK default project ID if not configured; not recommended for production)
|
|
642
686
|
|
|
643
687
|
**Mobile (Dapp browser / wallet app):**
|
|
644
688
|
- Uses injected provider directly
|
|
645
689
|
|
|
690
|
+
Only configure `walletConnectProjectId` when your product needs Web3 wallet login
|
|
691
|
+
or wallet-based rewards (wallet binding, on-chain verification, NFT/token claiming).
|
|
692
|
+
|
|
646
693
|
To enable WalletConnect in the dialog:
|
|
647
694
|
|
|
648
695
|
```tsx
|
|
649
696
|
<TaskOnProvider
|
|
650
697
|
config={{
|
|
651
|
-
|
|
698
|
+
clientId: "your-client-id",
|
|
652
699
|
walletConnectProjectId: "your-project-id", // Get from cloud.walletconnect.com
|
|
653
700
|
}}
|
|
654
701
|
>
|
|
@@ -658,10 +705,10 @@ To enable WalletConnect in the dialog:
|
|
|
658
705
|
|
|
659
706
|
### Built-in Wallet Management
|
|
660
707
|
|
|
661
|
-
If no external
|
|
708
|
+
If no external adapter is provided, the widget uses built-in wallet management. No configuration needed:
|
|
662
709
|
|
|
663
710
|
```tsx
|
|
664
|
-
<TaskOnProvider config={{
|
|
711
|
+
<TaskOnProvider config={{ clientId: "your-client-id" }}>
|
|
665
712
|
<App /> {/* Widget handles wallet connection internally */}
|
|
666
713
|
</TaskOnProvider>
|
|
667
714
|
```
|
|
@@ -675,9 +722,6 @@ interface WalletConfig {
|
|
|
675
722
|
|
|
676
723
|
// Solana wallet adapter (highest priority)
|
|
677
724
|
solanaAdapter?: WalletAdapter;
|
|
678
|
-
|
|
679
|
-
// Disable auto-detection of external providers
|
|
680
|
-
disableAutoDetect?: boolean;
|
|
681
725
|
}
|
|
682
726
|
```
|
|
683
727
|
|
|
@@ -716,7 +760,7 @@ const App = () => {
|
|
|
716
760
|
return (
|
|
717
761
|
<TaskOnProvider
|
|
718
762
|
config={{
|
|
719
|
-
|
|
763
|
+
clientId: "your-client-id",
|
|
720
764
|
walletConfig: { evmAdapter },
|
|
721
765
|
}}
|
|
722
766
|
>
|
|
@@ -731,7 +775,7 @@ const App = () => {
|
|
|
731
775
|
When multiple options are available:
|
|
732
776
|
|
|
733
777
|
1. **Custom Adapter** - `walletConfig.evmAdapter` / `solanaAdapter` (highest)
|
|
734
|
-
2. **Built-in Adapter** -
|
|
778
|
+
2. **Built-in Adapter** - SDK wallet picker adapter for EVM wallets (fallback)
|
|
735
779
|
|
|
736
780
|
## Hooks
|
|
737
781
|
|
|
@@ -1036,6 +1080,7 @@ Works with:
|
|
|
1036
1080
|
|
|
1037
1081
|
### Optional Peer Dependencies
|
|
1038
1082
|
|
|
1083
|
+
Install these only when you need Web3 wallet login or wallet-based reward flows.
|
|
1039
1084
|
For WalletConnect support in the built-in wallet binding dialog:
|
|
1040
1085
|
|
|
1041
1086
|
```bash
|
|
@@ -1047,7 +1092,7 @@ Then configure your project ID:
|
|
|
1047
1092
|
```tsx
|
|
1048
1093
|
<TaskOnProvider
|
|
1049
1094
|
config={{
|
|
1050
|
-
|
|
1095
|
+
clientId: "your-client-id",
|
|
1051
1096
|
walletConnectProjectId: "your-walletconnect-project-id",
|
|
1052
1097
|
}}
|
|
1053
1098
|
>
|
|
@@ -1057,7 +1102,16 @@ Then configure your project ID:
|
|
|
1057
1102
|
|
|
1058
1103
|
Get your WalletConnect Project ID at https://cloud.walletconnect.com
|
|
1059
1104
|
|
|
1060
|
-
If not configured, the
|
|
1105
|
+
If not configured, the SDK will use a built-in default WalletConnect project ID.
|
|
1106
|
+
For production use, strongly recommend configuring your own `walletConnectProjectId`.
|
|
1107
|
+
|
|
1108
|
+
## Limitations
|
|
1109
|
+
|
|
1110
|
+
- Quest Widget does not support opening pre-task targets from `CommunityPreTask` eligibility.
|
|
1111
|
+
- In eligibility rows, pre-task names are displayed as plain text (non-clickable).
|
|
1112
|
+
- Community names are hidden for `CommunityPreTask`, `CommunityUserPoints`, and `CommunityUserLevel` rows.
|
|
1113
|
+
- `DiscordRole` keeps original `in {community}` display and uses `server_url` as link when available.
|
|
1114
|
+
- CommunityTask eligibility `CommunityPreTask` supports clicking task names to switch task dialogs.
|
|
1061
1115
|
|
|
1062
1116
|
## License
|
|
1063
1117
|
|