{"_id":"@adpal/app-switcher","_rev":"6-753088fce81bdb165efd0cc54a828f96","name":"@adpal/app-switcher","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@adpal/app-switcher","version":"1.0.0","keywords":["adpal","app-switcher","multi-account","nextjs","react"],"author":{"name":"AdPal"},"license":"MIT","_id":"@adpal/app-switcher@1.0.0","maintainers":[{"name":"adpal","email":"support@adpal.com"}],"homepage":"https://github.com/Data-Subsystems/adpal-app-switcher#readme","bugs":{"url":"https://github.com/Data-Subsystems/adpal-app-switcher/issues"},"dist":{"shasum":"78916174db21ddbf69b0973a4fd7a1aee048fbd7","tarball":"https://registry.npmjs.org/@adpal/app-switcher/-/app-switcher-1.0.0.tgz","fileCount":14,"integrity":"sha512-AJlVC7qlwn6qxa8waMTa0kkmWMY3IHtJSp24H5A63sGqwbMD+IS2cw4Sx97qfwEX/MjD46vJE4LMqSgyJ9RMSg==","signatures":[{"sig":"MEUCIB17v5ivVlXirtdOkL5hbjPcEZErVvyFScighMyhXGaqAiEArJJe74mQvtwB1MYHC6lT+1qn8t6vepYkG0VjVI5R1sE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":361158},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.mjs","require":"./dist/config/index.js"}},"gitHead":"9bb2fbb8c39d168e3fd9a546451ad074700efefb","scripts":{"dev":"tsup --watch","lint":"eslint src/","build":"tsup","storybook":"storybook dev -p 6006","typecheck":"tsc --noEmit","prepublishOnly":"npm run build","build-storybook":"storybook build"},"_npmUser":{"name":"adpal","email":"support@adpal.com"},"repository":{"url":"git+https://github.com/Data-Subsystems/adpal-app-switcher.git","type":"git"},"_npmVersion":"11.6.2","description":"Shared app switcher and multi-account components for AdPal products","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"lucide-react":"^0.400.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vite":"^5.4.21","eslint":"^8.0.0","storybook":"^8.6.15","typescript":"^5.0.0","@types/node":"^20.0.0","@types/react":"^18.0.0","@storybook/react":"^8.6.15","@types/react-dom":"^18.0.0","@storybook/blocks":"^8.6.14","@storybook/react-vite":"^8.6.15","@storybook/addon-essentials":"^8.6.14"},"peerDependencies":{"next":">=14.0.0","react":">=18.0.0","next-auth":">=4.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/app-switcher_1.0.0_1769310266221_0.3869210326673027","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@adpal/app-switcher","version":"1.0.1","keywords":["adpal","app-switcher","multi-account","nextjs","react"],"author":{"name":"AdPal"},"license":"MIT","_id":"@adpal/app-switcher@1.0.1","maintainers":[{"name":"adpal","email":"support@adpal.com"}],"homepage":"https://github.com/Data-Subsystems/adpal-app-switcher#readme","bugs":{"url":"https://github.com/Data-Subsystems/adpal-app-switcher/issues"},"dist":{"shasum":"0108646aead3424752fc6de90e654f217680f056","tarball":"https://registry.npmjs.org/@adpal/app-switcher/-/app-switcher-1.0.1.tgz","fileCount":14,"integrity":"sha512-dsiy8Bvz5k0WZZBzx9PtNMYLajcfHg7n2gkxE/8kb2NVhuMKxefGSgerx8C8xYfZxh8RLpNbxX9t0SvaDvks1Q==","signatures":[{"sig":"MEUCIQDvvO9NutEdOSZaVXMSZDJl09MAmo52gq5kpwtoxfXmDAIgclW1Qn62Pd2ZjI4+khJwN/7TZvzT4d9FKKzyHTi2ojQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":361158},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.mjs","require":"./dist/config/index.js"}},"gitHead":"d1e9351d0450e187c8269059738adb10763f76fe","scripts":{"dev":"tsup --watch","lint":"eslint src/","build":"tsup","storybook":"storybook dev -p 6006","typecheck":"tsc --noEmit","prepublishOnly":"npm run build","build-storybook":"storybook build"},"_npmUser":{"name":"adpal","email":"support@adpal.com"},"repository":{"url":"git+https://github.com/Data-Subsystems/adpal-app-switcher.git","type":"git"},"_npmVersion":"11.6.2","description":"Shared app switcher and multi-account components for AdPal products","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"lucide-react":"^0.400.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vite":"^5.4.21","eslint":"^8.0.0","storybook":"^8.6.15","typescript":"^5.0.0","@types/node":"^20.0.0","@types/react":"^18.0.0","@storybook/react":"^8.6.15","@types/react-dom":"^18.0.0","@storybook/blocks":"^8.6.14","@storybook/react-vite":"^8.6.15","@storybook/addon-essentials":"^8.6.14"},"peerDependencies":{"next":">=14.0.0","react":">=18.0.0","next-auth":">=4.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/app-switcher_1.0.1_1769311032562_0.4765409987196876","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@adpal/app-switcher","version":"1.0.2","keywords":["adpal","app-switcher","multi-account","nextjs","react"],"author":{"name":"AdPal"},"license":"MIT","_id":"@adpal/app-switcher@1.0.2","maintainers":[{"name":"adpal","email":"support@adpal.com"}],"homepage":"https://github.com/Data-Subsystems/adpal-app-switcher#readme","bugs":{"url":"https://github.com/Data-Subsystems/adpal-app-switcher/issues"},"dist":{"shasum":"959aa36c949926716f4ee73aa6c85819f5dced05","tarball":"https://registry.npmjs.org/@adpal/app-switcher/-/app-switcher-1.0.2.tgz","fileCount":14,"integrity":"sha512-+GLhnTa2NWOzXRQjCUQ+8aHNrWhsLeELf13zoA2x8754fAFTaD9zPb62MkcBTYR1GtPVX5zHtpC7QwXBAdyHGg==","signatures":[{"sig":"MEUCIQDrsLIKHPK7AVg7mOZ1EbbrsREHqrXJ7UCXiszFdaU9cQIgQrZjq5efZPyCffAw3UK3qb1PelgzMoi+9d0xguHg1HU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":360754},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.mjs","require":"./dist/config/index.js"}},"gitHead":"e5c66861a5c0d6c08bd2b005363fce91dc4ab252","scripts":{"dev":"tsup --watch","lint":"eslint src/","build":"tsup","storybook":"storybook dev -p 6006","typecheck":"tsc --noEmit","prepublishOnly":"npm run build","build-storybook":"storybook build"},"_npmUser":{"name":"adpal","email":"support@adpal.com"},"repository":{"url":"git+https://github.com/Data-Subsystems/adpal-app-switcher.git","type":"git"},"_npmVersion":"11.6.2","description":"Shared app switcher and multi-account components for AdPal products","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"lucide-react":"^0.400.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vite":"^5.4.21","eslint":"^8.0.0","storybook":"^8.6.15","typescript":"^5.0.0","@types/node":"^20.0.0","@types/react":"^18.0.0","@storybook/react":"^8.6.15","@types/react-dom":"^18.0.0","@storybook/blocks":"^8.6.14","@storybook/react-vite":"^8.6.15","@storybook/addon-essentials":"^8.6.14"},"peerDependencies":{"next":">=14.0.0","react":">=18.0.0","next-auth":">=4.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/app-switcher_1.0.2_1769311589871_0.26234039961331646","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@adpal/app-switcher","version":"1.0.3","keywords":["adpal","app-switcher","multi-account","nextjs","react"],"author":{"name":"AdPal"},"license":"MIT","_id":"@adpal/app-switcher@1.0.3","maintainers":[{"name":"adpal","email":"support@adpal.com"}],"homepage":"https://github.com/Data-Subsystems/adpal-app-switcher#readme","bugs":{"url":"https://github.com/Data-Subsystems/adpal-app-switcher/issues"},"dist":{"shasum":"6f4944ee75aab2c2a0c5a81a2db1ed429e962412","tarball":"https://registry.npmjs.org/@adpal/app-switcher/-/app-switcher-1.0.3.tgz","fileCount":14,"integrity":"sha512-lg8ke867xFJN67M4GCamy1/4EL+AIetBxUGI7/LtANMS8fUAqWtUbRkK1peHao71q/zK/3vGW0ZcVnP0bkEzkg==","signatures":[{"sig":"MEUCIHMzpcyuQHTZqCz/E5A05zzUB8sXP6q4laDmowb/uGdxAiEAlxu+/cPOpodiZCU7ORibnXnzNKNDteNroLP/8lBUzZ8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":353494},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.mjs","require":"./dist/config/index.js"}},"gitHead":"832c21cf710c467b0595cbbffe9d3c7ce57c0cc5","scripts":{"dev":"tsup --watch","lint":"eslint src/","build":"tsup","storybook":"storybook dev -p 6006","typecheck":"tsc --noEmit","prepublishOnly":"npm run build","build-storybook":"storybook build"},"_npmUser":{"name":"adpal","email":"support@adpal.com"},"repository":{"url":"git+https://github.com/Data-Subsystems/adpal-app-switcher.git","type":"git"},"_npmVersion":"11.6.2","description":"Shared app switcher and multi-account components for AdPal products","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"lucide-react":"^0.400.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vite":"^5.4.21","eslint":"^8.0.0","storybook":"^8.6.15","typescript":"^5.0.0","@types/node":"^20.0.0","@types/react":"^18.0.0","@storybook/react":"^8.6.15","@types/react-dom":"^18.0.0","@storybook/blocks":"^8.6.14","@storybook/react-vite":"^8.6.15","@storybook/addon-essentials":"^8.6.14"},"peerDependencies":{"next":">=14.0.0","react":">=18.0.0","next-auth":">=4.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/app-switcher_1.0.3_1769312456800_0.8531499520442991","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@adpal/app-switcher","version":"1.0.4","keywords":["adpal","app-switcher","multi-account","nextjs","react"],"author":{"name":"AdPal"},"license":"MIT","_id":"@adpal/app-switcher@1.0.4","maintainers":[{"name":"adpal","email":"support@adpal.com"}],"homepage":"https://github.com/Data-Subsystems/adpal-app-switcher#readme","bugs":{"url":"https://github.com/Data-Subsystems/adpal-app-switcher/issues"},"dist":{"shasum":"067957da2b770d16fb49593dcdfaa04874b03c92","tarball":"https://registry.npmjs.org/@adpal/app-switcher/-/app-switcher-1.0.4.tgz","fileCount":14,"integrity":"sha512-Z604G0P3bLsnHvle2HaUwQonotuZ6qfRn7y+GK5EhKscg62BdZGYh6Y7vpm6BHhY2440MqDbcIatE31r7rhNlg==","signatures":[{"sig":"MEYCIQDyhtn6V554YZPq/1pRcVdNUXZ8/GMAqR8A4RvTitkWtwIhAN3gHruKgVTEEZc6s00Ax10+AxIMA9XAMqcqCOrHmQwQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":353502},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.mjs","require":"./dist/config/index.js"}},"gitHead":"e39172bc5818904d02b17dd4033e9ae67ed38e44","scripts":{"dev":"tsup --watch","lint":"eslint src/","build":"tsup","storybook":"storybook dev -p 6006","typecheck":"tsc --noEmit","prepublishOnly":"npm run build","build-storybook":"storybook build"},"_npmUser":{"name":"adpal","email":"support@adpal.com"},"repository":{"url":"git+https://github.com/Data-Subsystems/adpal-app-switcher.git","type":"git"},"_npmVersion":"11.6.2","description":"Shared app switcher and multi-account components for AdPal products","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"lucide-react":"^0.400.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vite":"^5.4.21","eslint":"^8.0.0","storybook":"^8.6.15","typescript":"^5.0.0","@types/node":"^20.0.0","@types/react":"^18.0.0","@storybook/react":"^8.6.15","@types/react-dom":"^18.0.0","@storybook/blocks":"^8.6.14","@storybook/react-vite":"^8.6.15","@storybook/addon-essentials":"^8.6.14"},"peerDependencies":{"next":">=14.0.0","react":">=18.0.0","next-auth":">=4.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/app-switcher_1.0.4_1769312614084_0.13326257655445306","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@adpal/app-switcher","version":"1.0.5","description":"Shared app switcher and multi-account components for AdPal products","sideEffects":false,"main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.mjs","require":"./dist/config/index.js"}},"scripts":{"build":"tsup","dev":"tsup --watch","lint":"eslint src/","typecheck":"tsc --noEmit","prepublishOnly":"npm run build","storybook":"storybook dev -p 6006","build-storybook":"storybook build"},"peerDependencies":{"next":">=14.0.0","next-auth":">=4.0.0","react":">=18.0.0","react-dom":">=18.0.0"},"devDependencies":{"@storybook/addon-essentials":"^8.6.14","@storybook/blocks":"^8.6.14","@storybook/react":"^8.6.15","@storybook/react-vite":"^8.6.15","@types/node":"^20.0.0","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","eslint":"^8.0.0","storybook":"^8.6.15","tsup":"^8.0.0","typescript":"^5.0.0","vite":"^5.4.21"},"dependencies":{"lucide-react":"^0.400.0"},"repository":{"type":"git","url":"git+https://github.com/Data-Subsystems/adpal-app-switcher.git"},"bugs":{"url":"https://github.com/Data-Subsystems/adpal-app-switcher/issues"},"homepage":"https://github.com/Data-Subsystems/adpal-app-switcher#readme","keywords":["adpal","app-switcher","multi-account","nextjs","react"],"author":{"name":"AdPal"},"license":"MIT","publishConfig":{"access":"public"},"gitHead":"5b805ee684ec025dc6b5bcb301ef43f7df86df16","_id":"@adpal/app-switcher@1.0.5","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-eB8/cVA+gF69tHFuGKNCi5jFPX+p0aloLOwu8QY3RuYz6UxyUy8ZEvl59br1HqHrZYLC0rNRCpmOGVVTCnkfxQ==","shasum":"a68fc29295a1716bcfc532a16c52e759e00d693b","tarball":"https://registry.npmjs.org/@adpal/app-switcher/-/app-switcher-1.0.5.tgz","fileCount":14,"unpackedSize":337332,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCrba6/RczPdNo7Td5aCazN7XwWcYAJCTTHpW3UCtN3mgIgU7aKPFK7Y4ve27pUSlWji8P4Tc62cVDddqmWhzjPCFw="}]},"_npmUser":{"name":"adpal","email":"support@adpal.com"},"directories":{},"maintainers":[{"name":"adpal","email":"support@adpal.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/app-switcher_1.0.5_1769312921519_0.698692672802435"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-25T03:04:26.149Z","modified":"2026-01-25T03:48:41.800Z","1.0.0":"2026-01-25T03:04:26.386Z","1.0.1":"2026-01-25T03:17:12.748Z","1.0.2":"2026-01-25T03:26:30.014Z","1.0.3":"2026-01-25T03:40:56.973Z","1.0.4":"2026-01-25T03:43:34.239Z","1.0.5":"2026-01-25T03:48:41.682Z"},"bugs":{"url":"https://github.com/Data-Subsystems/adpal-app-switcher/issues"},"author":{"name":"AdPal"},"license":"MIT","homepage":"https://github.com/Data-Subsystems/adpal-app-switcher#readme","keywords":["adpal","app-switcher","multi-account","nextjs","react"],"repository":{"type":"git","url":"git+https://github.com/Data-Subsystems/adpal-app-switcher.git"},"description":"Shared app switcher and multi-account components for AdPal products","maintainers":[{"name":"adpal","email":"support@adpal.com"}],"readme":"# @adpal/app-switcher\n\nShared app switcher and multi-account components for AdPal products. Provides a Google Workspace-style header with app grid and multi-account support.\n\n## Features\n\n- **AppSwitcher** - Google Workspace-style app grid for switching between AdPal products\n- **AccountDropdown** - Multi-account support with account switching\n- **AccountAvatar** - Reusable avatar component with loading states and fallbacks\n- **Header** - Combined header component with app switcher and account menu\n- **useLinkedAccounts** - Hook for cross-subdomain account persistence\n- **Custom SVG Icons** - Gradient icons with glow effects (BizIntel, Data, Voice, MCP)\n\n## Installation\n\n```bash\n# From GitHub (recommended for private repos)\nnpm install github:Data-Subsystems/adpal-app-switcher\n\n# Or from npm (if published)\nnpm install @adpal/app-switcher\n```\n\n## Peer Dependencies\n\n- `react` >= 18.0.0\n- `react-dom` >= 18.0.0\n- `next` >= 14.0.0\n- `next-auth` >= 4.0.0\n\n## Quick Start\n\n### 1. Install the package\n\n```bash\nnpm install github:Data-Subsystems/adpal-app-switcher\n```\n\n### 2. Create Header component\n\n```tsx\n// components/layout/Header.tsx\n'use client';\n\nimport { useSession, signOut } from 'next-auth/react';\nimport { useRouter } from 'next/navigation';\nimport { Header as SharedHeader, themes } from '@adpal/app-switcher';\n\nexport function Header() {\n  const router = useRouter();\n  const { data: session, status } = useSession();\n\n  const handleSwitchAccount = async (account: { email: string }) => {\n    await signOut({ redirect: false });\n    const response = await fetch('/api/auth/switch', {\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      body: JSON.stringify({ email: account.email }),\n    });\n    if (response.ok) {\n      const { redirectUrl } = await response.json();\n      window.location.href = redirectUrl;\n    }\n  };\n\n  const handleAddAccount = async () => {\n    const response = await fetch('/api/auth/switch', {\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      body: JSON.stringify({ addNew: true }),\n    });\n    if (response.ok) {\n      const { redirectUrl } = await response.json();\n      window.location.href = redirectUrl;\n    }\n  };\n\n  return (\n    <SharedHeader\n      user={session?.user ?? null}\n      isLoading={status === 'loading'}\n      theme={themes.blue}  // or themes.cyan\n      heightClass=\"h-14\"\n      appSwitcher={{\n        currentAppId: 'bizintel',  // or 'data'\n      }}\n      accountDropdown={{\n        onSwitchAccount: handleSwitchAccount,\n        onAddAccount: handleAddAccount,\n        onSignOut: () => signOut({ callbackUrl: '/auth/signin' }),\n      }}\n    />\n  );\n}\n```\n\n### 3. Create API routes\n\n```typescript\n// app/api/auth/switch/route.ts\nimport { NextRequest, NextResponse } from 'next/server';\n\nexport async function POST(request: NextRequest) {\n  try {\n    const body = await request.json();\n    const { email, addNew } = body;\n\n    const baseUrl = process.env.NEXTAUTH_URL || 'http://localhost:3000';\n    const params = new URLSearchParams({ callbackUrl: `${baseUrl}/` });\n\n    if (email && !addNew) {\n      params.set('login_hint', email);\n    }\n\n    const redirectUrl = `${baseUrl}/api/auth/signin/google?${params.toString()}`;\n    return NextResponse.json({ redirectUrl });\n  } catch {\n    return NextResponse.json({ error: 'Invalid request' }, { status: 400 });\n  }\n}\n```\n\n### 4. Update auth config\n\n```typescript\n// lib/auth-options.ts\nGoogleProvider({\n  clientId: process.env.GOOGLE_CLIENT_ID!,\n  clientSecret: process.env.GOOGLE_CLIENT_SECRET!,\n  authorization: {\n    params: {\n      prompt: 'select_account',  // Enable account picker\n    },\n  },\n}),\n```\n\n### 5. Update middleware\n\n```typescript\n// middleware.ts\nconst publicPaths = [\n  // ... existing paths\n  '/api/auth/accounts',\n  '/api/auth/switch',\n];\n```\n\n## Available Apps\n\n| ID | Name | URL | Icon Color |\n|----|------|-----|------------|\n| `bizintel` | Business Intelligence | https://b.adpal.com | Gold |\n| `data` | Data Processing | https://d.adpal.com | Cyan |\n| `voice` | Voice Assistant | https://voice.adpal.com | Green |\n| `mcp-demo` | MCP Demo | https://mcp-demo.adpal.com | Purple |\n\n## Themes\n\n```typescript\nimport { themes } from '@adpal/app-switcher';\n\n// Available themes\nthemes.blue    // Default - blue accent\nthemes.cyan    // Cyan accent (#00BCD4)\nthemes.emerald // Green accent\n\n// Or create custom\nconst customTheme = {\n  accent: '#FF5722',\n  ringColor: 'ring-orange-200',\n  currentBg: 'bg-orange-50',\n};\n```\n\n## Components API\n\n### Header\n\n```tsx\n<Header\n  user={session?.user ?? null}\n  isLoading={status === 'loading'}\n  theme={themes.blue}\n  heightClass=\"h-14\"          // Header height (h-12, h-14, h-16)\n  sidebarOffset=\"left-64\"     // Left offset for sidebar\n  appSwitcher={{\n    currentAppId: 'bizintel',\n    showHeader: true,\n    showFooter: true,\n    columns: 3,\n  }}\n  accountDropdown={{\n    onSwitchAccount: (account) => {},\n    onAddAccount: () => {},\n    onSignOut: () => {},\n    showManageAccount: true,\n  }}\n/>\n```\n\n### AppSwitcher\n\n```tsx\n<AppSwitcher\n  currentAppId=\"bizintel\"     // Highlight current app\n  apps={ADPAL_APPS}           // Custom apps list\n  showInternalApps={true}     // Show internal-only apps\n  iconSize={48}               // Icon size in pixels\n  columns={3}                 // Grid columns (2 or 3)\n  showHeader={true}           // Show \"Adpal Apps\" header\n  showFooter={true}           // Show \"More from Adpal\" footer\n  onAppClick={(app) => {}}    // Custom click handler\n/>\n```\n\n### AccountDropdown\n\n```tsx\n<AccountDropdown\n  user={{ id, email, name, image }}\n  isLoading={false}\n  onSwitchAccount={(account) => {}}\n  onAddAccount={() => {}}\n  onSignOut={() => {}}\n  showManageAccount={true}\n  manageAccountUrl=\"https://myaccount.google.com\"\n/>\n```\n\n### useLinkedAccounts Hook\n\n```tsx\nconst {\n  accounts,           // LinkedAccount[]\n  isLoaded,          // boolean\n  addAccount,        // (account) => void\n  removeAccount,     // (accountId) => void\n  updateLastUsed,    // (accountId) => void\n  clearAllAccounts,  // () => void\n} = useLinkedAccounts({\n  cookieDomain: '.adpal.com',  // Optional\n  maxAccounts: 5,              // Optional\n});\n```\n\n## Cross-Subdomain Account Persistence\n\nLinked accounts are stored in a cookie with domain `.adpal.com`, enabling account persistence across all AdPal subdomains:\n\n- Cookie name: `adpal-linked-accounts`\n- Max accounts: 5\n- Expiry: 30 days\n- Fallback: localStorage (if cookie exceeds 4KB)\n\n## Projects Using This Package\n\n| Project | Subdomain | Theme | Current App ID |\n|---------|-----------|-------|----------------|\n| adpal-ai-bizintel | b.adpal.com | `themes.blue` | `bizintel` |\n| adpal-ai-data | d.adpal.com | `themes.cyan` | `data` |\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Watch mode\nnpm run dev\n\n# Type check\nnpm run typecheck\n```\n\n## Updating the Package\n\nAfter making changes:\n\n```bash\n# Build and commit\nnpm run build\ngit add -A\ngit commit -m \"description\"\ngit push\n\n# Update in consuming projects\ncd ../adpal-ai-data\nnpm update @adpal/app-switcher\n\ncd ../adpal-ai-bizintel\nnpm update @adpal/app-switcher\n```\n\n## Repository\n\nhttps://github.com/Data-Subsystems/adpal-app-switcher\n\n## License\n\nMIT\n","readmeFilename":"README.md"}