Configuration
TaskOnEmbed is initialized with TaskOnEmbedConfig.
new TaskOnEmbed(config: TaskOnEmbedConfig);TaskOnEmbedConfig
| Field | Type | Required | Description |
|---|---|---|---|
baseUrl | string | Yes | Base URL of TaskOn service (for example https://taskon.xyz) |
containerElement | string | HTMLElement | Yes | CSS selector or actual container element |
width | string | number | No | Iframe width (default: 100%) |
height | string | number | No | Iframe height (default: 100%) |
language | string | No | Initial language (en, ko, ru, es, ja, etc.) |
isDev | boolean | No | Development OAuth mode switch |
tabsInclude | CommunityTabKey[] | No | Whitelist visible tabs (higher priority than tabsExclude) |
tabsExclude | CommunityTabKey[] | No | Blacklist hidden tabs |
baseUrl Input Rules
baseUrl supports both full URLs and host-only values.
- Full URL:
https://taskon.xyz - Host only:
taskon.xyz(auto-resolved tohttps://taskon.xyz/) - Local host:
localhost:5173(auto-resolved tohttp://localhost:5173/)
Protocol rules:
- Local hosts (
localhost,127.0.0.1,[::1],0.0.0.0) default tohttp:// - Non-local hosts default to
https:// - Only
http://andhttps://are supported
Examples:
new TaskOnEmbed({
baseUrl: "taskon.xyz",
containerElement: "#taskon-embed",
});
new TaskOnEmbed({
baseUrl: "localhost:5173",
containerElement: "#taskon-embed",
});CommunityTabKey
Supported tab keys:
homequestsleaderboardincentivesbenefitwheelOfFortuneeventsmilestone
Tab Visibility Examples
const embed = new TaskOnEmbed({
baseUrl: "https://your_embed_domain.com",
containerElement: "#taskon-embed",
tabsInclude: ["home", "quests", "leaderboard"],
});const embed = new TaskOnEmbed({
baseUrl: "https://your_embed_domain.com",
containerElement: "#taskon-embed",
tabsExclude: ["benefit", "wheelOfFortune"],
});When both are provided, tabsInclude takes precedence.
Size Strategy
- Use
width: "100%"for responsive layouts - Prefer explicit height (for example
height: "700px") for stable rendering - You can change size later with
updateSize()(see Methods)
Last updated on