Installation
Requirements
- React 18 or 19
- TypeScript 5.0+ (recommended)
Install
npm install @taskon/widget-react @taskon/coreEntry Points
@taskon/widget-react provides multiple entry points for tree-shaking and CSS code splitting:
@taskon/widget-react/coreis the widget-react sub-entry (React providers/hooks),
not the separate@taskon/coreAPI client package.
| Entry Point | Import Path | What’s Included |
|---|---|---|
| Core | @taskon/widget-react/core | Providers, hooks, locale helpers, minimal base CSS |
| Quest | @taskon/widget-react/quest | Quest widget only |
| Community Task | @taskon/widget-react/community-task | Community task widget only |
| Leaderboard | @taskon/widget-react/leaderboard | Leaderboard widget only |
| User Center | @taskon/widget-react/user-center | User center widget only |
| Page Builder | @taskon/widget-react/page-builder | Page composer widget |
| All | @taskon/widget-react | Everything (all widgets + all CSS) |
Recommended Import Pattern
// Core imports
import { TaskOnProvider, ThemeProvider } from "@taskon/widget-react/core";
// Widget imports (load only what you use)
import { QuestWidget } from "@taskon/widget-react/quest";
import { CommunityTaskList } from "@taskon/widget-react/community-task";Full Import (Convenient, but larger bundle)
import {
TaskOnProvider,
ThemeProvider,
QuestWidget,
CommunityTaskList,
} from "@taskon/widget-react";CSS Handling
Widget styles are injected automatically by each entry point.
No extra CSS import is required.
widgetId and Local Mode
widgetIdmode: configure widget in taskon.xyz dashboard (Business Entity Hub / White-Label / Widget) and use generated numeric ID at runtime.- Local mode: do not pass
widgetId; render widgets with local props (campaignId,config,pageId, etc.).
Last updated on