Why Mythical Play Hub SDK?
Profile First
Supabase Auth and Play Hub profiles are the identity layer for games, sessions, and rankings.
Linked Wallets
Connect Ardor and Polygon wallets to the same Play Hub profile without making wallets the account.
Guest Mode
Let players try games with anonymous Supabase auth while blocking permanent rankings and rewards.
Rewards Ready
Check reward eligibility against persistent profiles and linked wallet requirements.
TypeScript First
Full TypeScript support with strict types, autocomplete, and excellent DX.
Simple Integration
Create a Play Hub client and use the same object for auth, profiles, sessions, wallets, and on-chain actions.
import { createMythicalSDK } from "@mythicalb/sdk";
const mythical = createMythicalSDK({
supabase: { url, anonKey },
game: {
id: "card_game",
modeId: "casual",
seasonId: "card_game_casual_season_1"
},
ardor: { hostOrigin: "https://store.mythicalbeings.io" },
polygon: { provider: window.ethereum }
});
const user = await mythical.auth.signInAsGuest("Guest Player");
const profile = await mythical.profile.getOrCreate();
console.log(user.isGuest);
console.log(profile.id);
const session = await mythical.sessions.create();
mythical.sessions.subscribe(session.session_id, {
onSessionChange: refreshSession,
onParticipantsChange: refreshPlayers
});
await mythical.wallets.connect("polygon");
await mythical.wallets.connect("ardor");
const eligibility = await mythical.rewards.canClaim({
chain: "polygon"
});
How It Works
Your Game
web, iframe, or embedded
Game UI@mythicalb/sdk
auth, sessions, wallets
Play Hub ClientPlay Hub + Chains
Supabase, Ardor, Polygon
Backend + walletsProfiles and sessions live in Supabase. Wallet operations remain opt-in and signed by Ardor or Polygon providers.
Packages
@mythicalb/sdk
Unified SDK for Play Hub profiles, sessions, linked wallets, leaderboards, and rewards.
npm i @mythicalb/sdk
@mythicalb/ardor-provider
Game-side SDK for iframe communication. This is what you install in your game.
npm i @mythicalb/ardor-provider
@mythicalb/ardor-host
Wallet-side SDK for the Mythical Store. Only needed if building the host.
npm i @mythicalb/ardor-host
@mythicalb/ardor-core
Shared types, utilities, and Ardor client. Used internally by other packages.
npm i @mythicalb/ardor-core
Ready to Build?
Check out the quick start guide to integrate the SDK into your game in minutes.