Last updated

/iblai-vibe-account

Mirrored from iblai/base · skills/organizations/iblai-vibe-account/SKILL.md. This page is generated — edit it in the repository, not here.

First time here? If iblai.env has no ARCHITECTURE=, run /iblai-vibe-start first (four questions; two minutes) — it decides single-org / multi-org / headless and who signs in, and every skill reads the answer.

Add an account/organization settings page whose sidebar groups its tabs under five headings: Workspace (Organization, Management, Invites, Onboarding, Apps), Integrations (API, Secrets, Network), Finance (Monetization, Billing), AI & data (Benchmarks, Memory) and System (Advanced). A group whose tabs are all gated off disappears, so a small organization sees three or four headings, not five.

Account Page
Account Page

Template: the page this skill creates is bundled as assets/account-page.tsx. For a navbar with links to it, run /iblai-vibe-navbar first.

Common setup (brand, conventions, env files, verification): see docs/skill-setup.md.

Step 0: Start from vibe-starter? (new projects)

Before running this skill, ask the user:

Are you starting a new project from scratch? vibe-starter (https://github.com/iblai/base/tree/main/skills/start/iblai-vibe-ops-init/assets/vibe-starter) already ships the /account page wired up, alongside auth, navbar, and profile/notifications. Want to use that instead?

If yes, copy it from the installed iblai-vibe-ops-init skill's assets/vibe-starter/ (in the vibe repo it lives under skills/start/), or fetch it from the vibe repo when those assets are not installed. Tell the user which path you took, then skip this skill:

cp -a <skills-dir>/iblai-vibe-ops-init/assets/vibe-starter/. .
# or, without local assets:
git clone --depth 1 https://github.com/iblai/base.git vibe-tmp && cp -a vibe-tmp/skills/start/iblai-vibe-ops-init/assets/vibe-starter/. . && rm -rf vibe-tmp

pnpm install --ignore-scripts   # skips package lifecycle (postinstall) scripts

If they prefer to add the account page to an existing app, continue below.

Prerequisites

  • Auth must be set up first (/iblai-vibe-auth)
  • MCP server + skills configured (@iblai/mcp in .mcp.json)

Step 1: Check Environment

Check for an iblai.env in the project root with PLATFORM, DOMAIN and TOKEN. If it is missing, tell the user: "You need an iblai.env with your platform configuration. Download the template and fill in your values: curl -o iblai.env https://raw.githubusercontent.com/iblai/base/refs/heads/main/iblai.env"

Step 2: Create the Page

Copy assets/account-page.tsx into app/(app)/account/page.tsx (the only file this skill creates), or use the reference implementation in Step 3. The page reads userData, tenant/current_tenant and tenants from localStorage; admin status comes from the tenants array.

Step 3: Wrap in a White Container

The SDK Account component has no outer background. Wrap it in a white container so it renders as a card against the gray page background (--sidebar-bg: #fafbfc).

Reference implementation

// app/(app)/account/page.tsx
"use client";

import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { Account } from "@iblai/iblai-js/web-containers/next";
import { useSubscriptionConfig } from "@iblai/iblai-js/web-utils";
import config from "@/lib/iblai/config";
import { resolveAppTenant } from "@/lib/iblai/tenant";

export default function AccountPage() {
  const router = useRouter();
  // The platform's main organization (`main` unless the provider says
  // otherwise), which the Billing tab keys the free trial and plans on.
  const { mainTenantKey: platformMainOrg } = useSubscriptionConfig();
  const [username, setUsername] = useState("");
  const [email, setEmail] = useState("");
  const [tenantKey, setTenantKey] = useState("");
  const [tenants, setTenants] = useState<any[]>([]);
  const [isAdmin, setIsAdmin] = useState(false);
  const [ready, setReady] = useState(false);

  useEffect(() => {
    try {
      const raw = localStorage.getItem("userData");
      if (raw) {
        const parsed = JSON.parse(raw);
        setUsername(parsed.user_nicename ?? parsed.username ?? "");
        setEmail(parsed.user_email ?? parsed.email ?? "");
      }
    } catch {}

    const resolved = resolveAppTenant();
    setTenantKey(resolved);

    try {
      const tenantsRaw = localStorage.getItem("tenants");
      if (tenantsRaw) {
        const parsed = JSON.parse(tenantsRaw);
        setTenants(parsed);
        const match = parsed.find((t: any) => t.key === resolved);
        if (match) setIsAdmin(!!match.is_admin);
      }
    } catch {}

    setReady(true);
  }, []);

  if (!ready || !tenantKey) {
    return (
      <div className="flex flex-1 items-center justify-center">
        <p className="text-sm text-gray-400">Loading account settings...</p>
      </div>
    );
  }

  return (
    <div className="mx-auto w-full flex-1 overflow-auto px-4 py-8 md:w-[75vw] md:px-0">
      <div className="rounded-lg border border-[var(--border-color)] bg-white overflow-hidden">
        <Account
          tenant={tenantKey}
          tenants={tenants}
          username={username}
          email={email}
          mainPlatformKey={platformMainOrg}
          isAdmin={isAdmin}
          authURL={config.authUrl()}
          currentPlatformBaseDomain={config.platformBaseDomain()}
          currentSPA="agent"
          onInviteClick={() => {}}
          onClose={() => router.push("/")}
          targetTab="organization"
          showPlatformName={true}
          useGravatarPicFallback={true}
        />
      </div>
    </div>
  );
}

Step 4: Use MCP Tools for Customization

get_component_info("Account") lists every prop; these are the ones apps use.

<Account> Props

Required

PropTypeDescription
tenantstringPlatform key
tenantsTenant[]Full list of user platforms from localStorage
usernamestringUsername
emailstringUser email (from userData in localStorage)
mainPlatformKeystringMain org key — config.mainTenantKey()
onInviteClick() => voidCalled by the Invite buttons on Management's Users and Teams tabs, only for a user who is not shown the Invites tab; for one who is, those buttons open that tab
onClose() => voidCancel/close callback
authURLstringAuth service URL
isAdminbooleanControls tab visibility -- most tabs require true

Optional

PropTypeDescription
targetTabstringInitial tab: organization, management, invites, onboarding, apps, api, secrets, virtualMachine (Network), monetization, billing, datasets (Benchmarks), memory, advanced — a tab this viewer may not open falls back to their first visible one. The retired integrations still opens Secrets
helpUrlstringHelp-center address the API page's banner links to ("Help"); without it there is no link
currentPlatformBaseDomainstringBase domain for custom domain settings
currentSPAstringCurrent app identifier (e.g., "agent")
showBenchmarksbooleanShow the Benchmarks tab (default false; each app opts in)
showGradebookTabbooleanShow the Gradebook tab in the profile preview that Management → Users opens for a selected user
onTabChange(tabId: string) => voidFires with "billing" / "monetization" when either opens and with "" when you leave them — mirror it into your URL so those two tabs are linkable
userActiveAppUserApp | nullThe app whose plan Billing should show
currentPlanstringCurrent plan name, for the Billing header
defaultSupportPhonestringInitial support phone on the Organization tab when metadata has none
enableSupportPhonebooleanShow the support-phone field at all
onboardingBasePathstringBase URL for the copyable per-agent link on the Onboarding tab (<onboardingBasePath>/onboarding/<agent-id>); defaults to the browser's origin
enableCatalogInvitebooleanAdds the Courses and Programs invite tabs to the Invites tab (default false)
enableRbacbooleanTurn on RBAC permission checks for Management. Only ever pass this together with rbacPermissions — see the warning below
rbacPermissionsobjectThe caller's effective permissions, from POST /dm/api/core/rbac/permissions/check/. Defaults to {}
onLoadGroupPermissions(permissions: object) => voidOptional; the Teams tab calls it with group-scoped permissions so you can merge them back in
showPlatformNamebooleanShow platform name badge in sidebar
useGravatarPicFallbackbooleanUse Gravatar when no org logo

enableRbac without rbacPermissions hides Management entirely. checkRbacPermission(perms, resource, enableRbac) returns true when RBAC is off, but denies everything when it is on and the permissions object is empty, so the Management tab disappears even for an org admin. Pass both (load them with POST rbac/permissions/check/, see /iblai-vibe-rbac) or neither. Single-org apps whose admin routes are already admin-gated pass neither, as vibe-starter does; the ibl.ai OS's organization settings dialog passes both.

Layout and navigation

Account and Profile share one shell — a 280px sidebar (organization logo, name, key and role chip over grouped navigation) beside a content column with a fixed header carrying the active tab's title and description. Below lg the sidebar becomes a compact identity row and a scrolling strip of pills, the active one solid blue (the profile side: /iblai-vibe-profile).

Three things are specific to Account:

  • The navigation is buttons, not ARIA tabs. Each item is a plain <button> carrying aria-current="page" when active, inside nav[aria-label="Organization settings"] (the small-screen strip is "Organization settings (mobile)") — that is the selector to write e2e tests against, since Profile uses role="tab" instead. Arrow keys, Home and End still move between them.
  • targetTab falls back. Asking for a tab this viewer may not open — a watcher sent to organization, say — lands on the first tab they can actually see, and it re-runs once tenants arrives and the paywall and permission checks settle.
  • The dialogs take the new names too. PlatformAccountSheet opens on tab="invites" or tab="onboarding", and UserProfileModal on targetTab="invites" or "onboarding". Neither opens on Apps (PlatformAccountTab has no apps); open them on another tab and pick Apps in the sidebar. Both forward enableCatalogInvite.

Tabs

TabGrouptargetTab idRequires
OrganizationWorkspaceorganizationisAdmin === true
ManagementWorkspacemanagementenableRbac unset (every viewer, admin or not: with RBAC off each check passes), or enableRbac plus a rbacPermissions object granting one of /platforms/<org>/#can_manage_users, /groups/#list, /roles/#list, /policies/#list, /usergroups/#list, /watchedgroups/#list
InvitesWorkspaceinvites/platforms/<org>/#can_invite, held by an admin (with RBAC off that check passes) or, with enableRbac on, by any user. With RBAC off a user who is not an admin never sees it
OnboardingWorkspaceonboardingisAdmin === true — it used to be a Management sub-tab that anyone who could open Management saw
AppsWorkspaceappsisAdmin === true — the platform's hosting routes are admin-only, so the tab is hidden rather than failing
APIIntegrationsapiisAdmin === true and /apitokens/#list (with RBAC off that check passes) — the organization's Platform API Tokens
SecretsIntegrationssecretsisAdmin === true — keys from other services: LLMs, Services, Environment Variables
NetworkIntegrationsvirtualMachineisAdmin === true — the addresses agents' virtual machines may reach (see /iblai-vibe-virtual-machine)
MonetizationFinancemonetizationisAdmin === true (or enableRbac on), the organization has monetization enabled and the caller holds /platforms/<org>/#can_sell_items (with RBAC off that check passes automatically)
BillingFinancebillingThe organization's paywall is on (show_paywall) and the caller is an admin or holds /platforms/<org>/#can_sell_items (with RBAC off that check passes, so every viewer sees it) — Credits (the plan picker / Change Plan, Add Credits, Auto Recharge), Spend Limits, Agent Limits, User Limits (see /iblai-vibe-billing)
BenchmarksAI & datadatasetsshowBenchmarks and isAdmin === true — the organization's benchmarks (questions and expected answers for evaluating agents), on the same screens as the Evals tab's Manage Benchmarks (see /iblai-vibe-agent-evals)
MemoryAI & datamemoryisAdmin === true — organization-wide global and per-agent memories (see /iblai-vibe-memory)
AdvancedSystemadvancedisAdmin === true — organization-wide switches, among them Allow users to control chat privacy, the gate that turns Incognito on for the organization (PATCH …/chat-privacy-config/, admin-only; see /iblai-vibe-incognito)

Every tab but Management, Invites, Monetization and Billing needs isAdmin; the rows above say when those four open to other users. Secrets is split into LLMs, Services and Environment Variables, and the Memory tab into Global and Agent memories.

Invites, Onboarding and Apps

  • Invites — "Send invitations to new users and manage existing invites." The same invite form, invitation list and pages as InviteUserDialog (/iblai-vibe-invite), inside the settings page. enableCatalogInvite adds Courses and Programs tabs.
  • Onboarding — the screen that was Management's last sub-tab, moved as it is: search for agents, order them (the first is Default, met by users who arrive without a link), give each a Heading and Sub-Heading, Copy Link for each agent, and one Save. It saves into the organization's metadata (user_onboarding_form), and each agent card shows the agent's image, or its first letter.
  • Apps — "Your deployed apps — their addresses, domains, and builds." One card per app the signed-in admin deployed (/iblai-vibe-ops-deploy), two columns on wide screens: the name, its state (Live, Deploying, Building, Deploy failed, Build failed, Build canceled, Not deployed yet), the live address as a link, and each custom domain marked Verified or Verification required ("Runs on our shared domain — nothing to set up." when it has none). Delete asks first: the app goes offline and every domain attached to it is removed. With no apps it says "Apps you deploy appear here." Hooks (@iblai/iblai-js/data-layer): useGetHostingProjectsQuery, useGetHostingProjectDomainsQuery, useDeleteHostingProjectMutation; REST in /iblai-api-hosting.

The Integrations group

The rail sorts keys by whose they are: a key from another service goes under Secrets, a key ibl.ai makes for your own software under API.

  • API — "Let your own software work with ibl.ai." A banner (with a Help link when you pass helpUrl), Add API Key, and the keys: Name, Permission Mode, Created, Expires ("Never" when it has none), with a pencil and a bin per key. Add API Key asks for a name, an optional expiry date and a Permission Mode — Owner permissions (the key can do what you can do) or Token policies (only what the policies and groups you pick allow) — and shows the key once. These are the same keys as an agent's API tab (/iblai-vibe-agent-api); REST in /iblai-api-token.

  • Secrets — "Keys from other services, like OpenAI or Stripe, that ibl.ai and your agents use." Three sub-tabs, each with a sentence, an Add button and a table (LLMs and Services list each key's name and its masked start):

    • LLMs — an AI company's key; agents then answer with its models. Azure OpenAI lists its models under a chevron. Only a provider with a single key field, or Azure OpenAI, has a pencil; to replace a key with several fields (Bedrock, Google), delete it and add it again. In Add LLM a provider the organization already holds is greyed out ("Added"), except Azure OpenAI while it has models left to add.
    • Services — a key from a service the organization uses (the old Data Sources tab). Google Drive, Dropbox and OneDrive keys power the file picker on an agent's Datasets tab; a key such as Stripe's or ElevenLabs' can be given to an agent on its Sandbox tab (/iblai-vibe-agent-virtual-machine). Add Service asks for that service's own fields.
    • Environment Variables — keys an agent's virtual machine uses by name, sent only to the addresses you allow (/iblai-vibe-virtual-machine).

    A list the viewer may not read hides its own tab. REST: /iblai-api-integration.

  • Network — the networks agents' virtual machines may reach (/iblai-vibe-virtual-machine).

API and Secrets on their own. The ibl.ai OS opens these two from its sidebar without the settings rail. Both are exported:

"use client";

import { ApiTab, SecretsTab } from "@iblai/iblai-js/web-containers";

export function ApiPage({ tenantKey, username }: { tenantKey: string; username: string }) {
  return <ApiTab tenantKey={tenantKey} username={username} helpUrl="https://help.example.com" />;
}

export function SecretsPage({ tenantKey, username }: { tenantKey: string; username: string }) {
  return <SecretsTab tenantKey={tenantKey} username={username} />;
}

ApiTab also takes enableRbac and rbacPermissions (listing needs /apitokens/#list, adding /apitokens/#create). UserProfileDropdown fills helpUrl from its own Help item.

Management sub-tabs

Management is itself tabbed — Users, Groups, Roles, Policies, Teams, Alerts and Applications. The first six each show when the matching permission is granted (can_manage_users, /groups/#list, /roles/#list, /policies/#list, /usergroups/#list or can_invite, /watchedgroups/#list); Applications needs none. A pure watcher (/watchedgroups/#list, not an admin) gets only Users, listing the users they may watch. The Invite buttons on Users and Teams open the Invites tab, or call onInviteClick for a user who is not shown it.

Picking a user in Users opens their profile in a read-only preview — the same Profile component as /iblai-vibe-profile, minus Security, with the Usage tab showing that user's AI spend. showGradebookTab is the one customization this path forwards.

Step 5: Verify

Run /iblai-vibe-ops-test before telling the user the work is ready, and give every page, control and state this skill added its own checkpoint — one Playwright test titled <ID> · … in e2e/journeys/, listed in e2e/coverage.json; pnpm e2e:coverage must pass:

  1. pnpm build -- must pass with zero errors
  2. pnpm test -- vitest must pass
  3. Touch test /account in the browser as /iblai-vibe-ops-test says: open it, use every control this skill added, read the console, check the phone width.
  4. In the browser, check the sidebar headings against what the organization actually has — no Finance group unless it sells something, no Benchmarks unless you passed showBenchmarks; an admin sees Invites, Onboarding and Apps under Workspace — then open each tab the sidebar lists; none may 404 or come up blank.

Important Notes

  • Next.js required: Import from @iblai/iblai-js/web-containers/next (uses next/image)
  • Redux store: Must include mentorReducer and mentorMiddleware
  • initializeDataLayer(): 5 args (v1.2+)
  • @reduxjs/toolkit: Deduplicated via webpack aliases in next.config.ts
  • currentPlatformBaseDomain: Must be {config.platformBaseDomain()} — uses the config helper, not a raw env var. This is correct and intentional.
  • SDK hardcoded styles: Account uses bg-white and bg-gray-50 internally. Do NOT override them; wrap it in the white container (Step 3).
  • Give the wrapper a height: the settings shell fills its parent (h-full); the sidebar and the content panel only scroll independently when that parent is bounded — h-[80vh] or min-h-[640px] is enough. The reference wrapper is full width with px-4 on a phone, md:w-[75vw] above.
  • Billing is not URL-driven: it shows up when the organization's paywall is on and the caller may see it, not because you passed a Stripe URL.
  • Brand guidelines: BRAND.md

Copyright © ibl.ai | support@iblai.zendesk.com