Observed since 21 Oct, 09:16 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xobelisk/controller
Modal SDK for partner user login/authentication.
@0xobelisk/controller)Modal SDK that projects can embed for user login/auth. Published as @0xobelisk/controller, with ESM/CJS/UMD outputs and adapters for React, Vue, Svelte, Solid, Preact, Angular, and Cocos Creator.
Platform-specific guides available for:
src/) that creates/destroys the modal with a simple API.src/styles.css) with gradients, blur, and responsive layout.examples/basic) showing how to open the modal, plus a full-flow mock page (examples/full-flow) with CTA -> modal -> mock auth -> close,支持深色金色卡片风格。tsc (no runtime deps).npm install @0xobelisk/controller
import { createAuthModal } from '@0xobelisk/controller';
import '@0xobelisk/controller/styles.css';
const modal = createAuthModal({
onSelect: (providerId) => {
console.log('Selected:', providerId);
if (providerId === 'create-session') {
// Handle session creation
handleCreateSession();
} else if (providerId === 'quit') {
modal.close();
}
},
onClose: () => {
console.log('Modal closed');
}
});
modal.open();
import { useAuthModal } from '@0xobelisk/controller/react';
import '@0xobelisk/controller/styles.css';
export default function LoginPage() {
const modal = useAuthModal({
onSelect: (providerId) => {
console.log('Selected:', providerId);
if (providerId === 'create-session') {
handleCreateSession();
}
}
});
return <button onClick={modal.open}>Login</button>;
}
See complete integration guides for all platforms →
Session management with blockchain authentication:
import { runSessionFlow } from '@0xobelisk/controller';
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
const userKeypair = Ed25519Keypair.generate();
try {
const session = await runSessionFlow({
keypair: userKeypair,
endpoints: {
start: 'https://api.example.com/session/start',
create: 'https://api.example.com/session/create'
}
});
console.log('Session created:', session.sessionKey);
} catch (error) {
console.error('Session creation failed:', error);
}
See complete session management guide →
Run examples locally:
npm install
npm run build
npm run serve # http://localhost:4173
Examples available at:
http://localhost:4173/examples/basic/http://localhost:4173/examples/full-flow/const modal = createAuthModal({
variant: 'card',
accentColor: '#7a63ff',
backgroundImage: 'https://unpkg.com/@0xobelisk/controller/dist/dubhe.jpeg',
onSelect: (providerId) => {
console.log('Selected:', providerId);
}
});
const modal = createAuthModal({
accentColor: '#6366f1', // Indigo
onSelect: handleAuth
});
Adapters available for all major platforms:
@0xobelisk/controller/react@0xobelisk/controller/vue@0xobelisk/controller/svelte@0xobelisk/controller/solid@0xobelisk/controller/preact@0xobelisk/controller/angular@0xobelisk/controller/cocos@0xobelisk/controllerView platform-specific integration guides →
Returns an AuthModalController instance.
Options:
onSelect: (providerId: string) => void - Required callback when button clickedonClose?: () => void - Optional callback when modal closestitle?: string - Modal title (default: "Authenticate to continue")subtitle?: string - Modal subtitlevariant?: 'card' | 'split' - Layout variant (default: "split")accentColor?: string - Primary color (default: "#7a63ff")backgroundImage?: string - Background image URLbuttons?: AuthButton[] - Custom buttonscontainer?: HTMLElement - Mount container (default: document.body)Returns:
open() - Show the modalclose() - Hide the modaldestroy() - Remove and cleanupisOpen() - Check if modal is openContributions are welcome! Please feel free to submit a Pull Request.
MIT © Obelisk Labs
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
vueEnvironment{
"local_name": "vue",
"alias": false,
"peer_metadata": null
} | ^3.3.8 | development |
reactEnvironment{
"local_name": "react",
"alias": false,
"peer_metadata": null
} | ^18.2.0 | development |
preactEnvironment{
"local_name": "preact",
"alias": false,
"peer_metadata": null
} | ^10.27.2 | development |
rollupEnvironment{
"local_name": "rollup",
"alias": false,
"peer_metadata": null
} | ^4.6.1 | development |
svelteEnvironment{
"local_name": "svelte",
"alias": false,
"peer_metadata": null
} | ^4.2.20 | development |
solid-jsEnvironment{
"local_name": "solid-js",
"alias": false,
"peer_metadata": null
} | ^1.9.10 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.3.3 | development |
@types/reactEnvironment{
"local_name": "@types/react",
"alias": false,
"peer_metadata": null
} | ^18.2.58 | development |
@angular/coreEnvironment{
"local_name": "@angular/core",
"alias": false,
"peer_metadata": null
} | ^17.0.0 | development |
@types/react-domEnvironment{
"local_name": "@types/react-dom",
"alias": false,
"peer_metadata": null
} | ^18.2.19 | development |
@rollup/plugin-typescriptEnvironment{
"local_name": "@rollup/plugin-typescript",
"alias": false,
"peer_metadata": null
} | ^11.1.6 | development |
@rollup/plugin-node-resolveEnvironment{
"local_name": "@rollup/plugin-node-resolve",
"alias": false,
"peer_metadata": null
} | ^15.2.3 | development |
vueEnvironment{
"local_name": "vue",
"alias": false,
"peer_metadata": null
} | ^3.3.0 | peer |
reactEnvironment{
"local_name": "react",
"alias": false,
"peer_metadata": null
} | ^18.0.0 | peer |
preactEnvironment{
"local_name": "preact",
"alias": false,
"peer_metadata": null
} | ^10.19.3 | peer |
svelteEnvironment{
"local_name": "svelte",
"alias": false,
"peer_metadata": null
} | ^4.2.0 | peer |
solid-jsEnvironment{
"local_name": "solid-js",
"alias": false,
"peer_metadata": null
} | ^1.8.11 | peer |
@angular/coreEnvironment{
"local_name": "@angular/core",
"alias": false,
"peer_metadata": null
} | ^17.0.0 | peer |
Source distribution
{
"shasum": "754e3dcd9f02e2611b760abe8c126506486c1ff8",
"tarball": "https://registry.npmjs.org/@0xobelisk/controller/-/controller-0.0.3.tgz",
"fileCount": 44,
"integrity": "sha512-BsKEn0Omv2Xhn8IPFCF9Ygp4FWBUaAg1UnHZ1ZzAO/GBkz6CrXcvBs9014JTtI3PeehRgsczUN54MR/zctnGXQ==",
"signatures": [
{
"sig": "MEUCIQD456T9+QNr8IM5xufsxAbR3JNwireP/cEbY0ycomerJgIgbeQI9UUA97K992wlAIo/mifbfL+19URomC4GCG+mfuo=",
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
}
],
"unpackedSize": 575642
}Shared repository data · GitHub
Observed since 21 Oct, 09:16 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:ef8d606faaccec8ddf5e73801532899a813b77fdbdd150516ee78fc15136d24e