/iblai-vibe:iblai-vibe-user-metadatafrom ibl.ai vibe
Stores per-user custom data (preferences, feature flags, onboarding progress) on the ibl.ai platform using SDK metadata hooks with namespacing. Includes admin route for reading/writing other users' data.
Ships in ibl.ai vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
First time here? If
iblai.envhas noARCHITECTURE=, run/iblai-vibe-startfirst (four questions; two minutes) — it decides single-org / multi-org / headless and who signs in, and every skill reads the answer.
Every ibl.ai user carries one schemaless JSON object per organization. It is the place for everything your app needs to remember about a person that is not their profile identity: preferences, flags, onboarding progress, app state. No database, no localStorage — it follows the user to every device and every build of the app.

Common setup (brand, conventions, env files, verification): see docs/skill-setup.md.
useUserSettings<T>() — typed, namespaced read/merge/remove over the SDK's
useGetUserPlatformMetadataQuery / useUpdateUserPlatformMetadataMutation
(PATCH — untouched keys survive).AppPreferences — a card with two example controls for /profile.app/api/admin/user-metadata/route.ts — the admin path: read/patch
another user's metadata with the org's authority (the hook cannot).vibe-starter ships all of this already; on an existing app, install per Step 2.
| Use it for | Not for |
|---|---|
| theme, language, layout choices | name, bio, avatar, social links → /iblai-vibe-profile (useGetUserMetadataQuery / useUpdateUserMetadataEdxMutation) |
| onboarding step, "seen the tour", dismissed banners | what an agent remembers about the user → /iblai-vibe-memory-guide |
| per-user feature flags, beta access | org-wide config → /iblai-vibe-org-metadata |
| lightweight app state (last-opened item, favorites) | secrets, tokens, payment data — never |
/iblai-vibe-auth, or vibe-starter)..env.local (NEXT_PUBLIC_MAIN_TENANT_KEY); the admin
route also needs IBLAI_API_KEY (server-only).…/dm/api/core/users/platform-metadata/?platform_key={org}. Auto-created on
first use ({}); keys and values are arbitrary JSON; the platform enforces
no schema.PATCH merges (metadata + delete_keys); PUT replaces; DELETE
resets to {}. The SDK hook does PATCH only — PUT/DELETE/delete_keys need
a direct call (the admin route shows how).&username=<other> — org admins only (403 otherwise,
404 for an unknown user). Confirm with the user before writing to someone
else's record.metadata.apps.<slug> (slug from
NEXT_PUBLIC_APP_NAME, else vibe-starter) so other apps on the same org
keep their own keys. The same convention vibe-agent uses.Copy the assets:
| Asset | Destination |
|---|---|
assets/metadata-core.ts | lib/iblai/metadata-core.ts (pure helpers, no SDK) |
assets/metadata.ts | lib/iblai/metadata.ts (the hooks; also exports useOrgSettings) |
assets/app-preferences.tsx | components/settings/app-preferences.tsx |
assets/admin-user-metadata-route.ts | app/api/admin/user-metadata/route.ts |
assets/metadata.test.ts | __tests__/metadata.test.ts |
metadata.ts imports resolveAppTenant from lib/iblai/tenant.ts and the
route imports lib/iblai/platform.ts (from /iblai-vibe-api) — install that
helper first on an app that lacks it. Needs shadcn card and switch:
pnpm dlx shadcn@latest add card switch (fix import { cn } from "cn" to
@/lib/utils if the generator writes it).
"use client";
import { useUserSettings } from "@/lib/iblai/metadata";
type MySettings = { favoriteTopic?: string; onboardingDone?: boolean };
export function FavoriteTopic() {
const { settings, update, isLoading } = useUserSettings<MySettings>({ favoriteTopic: "", onboardingDone: false });
if (isLoading) return null;
return (
<select
value={settings.favoriteTopic}
onChange={(e) => void update({ favoriteTopic: e.target.value })}
>
<option value="">Pick a topic</option>
<option value="billing">Billing</option>
<option value="shipping">Shipping</option>
</select>
);
}
update merges; remove(["favoriteTopic"]) deletes; reads fall back to your
defaults on error so the UI never breaks. Keep keys flat and named
consistently; batch related changes into one update.
Mount <AppPreferences /> on /profile (vibe-starter does) for the two example toggles.
The browser sends its session token; the route verifies the caller is an
org admin, then acts with IBLAI_API_KEY:
import { adminFetch } from "@/lib/iblai/admin-client";
await adminFetch("/api/admin/user-metadata", {
method: "PATCH",
json: { username: "jane", metadata: { role_label: "mentor" } },
});
const theirs = await adminFetch("/api/admin/user-metadata?username=jane");
Wire a UI for it only where it belongs (an admin page gated by /iblai-vibe-admin).
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. Then:
pnpm typecheck && pnpm test — __tests__/metadata.test.ts proves the namespace never clobbers other keys.pnpm dev, sign in, flip a toggle on /profile, reload — it sticks. Open the same account in another browser — it is there too./api/admin/user-metadata get 403.curl -s "https://api.$DOMAIN/dm/api/core/users/platform-metadata/?platform_key=$PLATFORM" -H "Authorization: Api-Token $TOKEN" shows apps.<slug> and nothing else changed.| Hook / call | Purpose |
|---|---|
useGetUserPlatformMetadataQuery({ tenantKey }) | the signed-in user's object |
useUpdateUserPlatformMetadataMutation() → ({ tenantKey, metadata }) | PATCH merge |
PUT / DELETE / delete_keys (REST only) | replace / reset / drop keys |
&username= (REST, org admin) | another user |
REST reference: iblai-api-profile-metadata
(concepts, best practices, and a migration strategy in its references/guide.md).
/iblai-vibe-org-metadata — the org-wide twin (public read, PUT replaces)/iblai-vibe-profile — identity fields/iblai-vibe-onboard — an onboarding flow that would write onboardingStep/iblai-vibe-api — the server-route pattern this skill's admin route followsassets/admin-user-metadata-route.ts (opens in a new tab)assets/app-preferences.tsx (opens in a new tab)assets/metadata-core.ts (opens in a new tab)assets/metadata.test.ts (opens in a new tab)assets/metadata.ts (opens in a new tab)iblai-vibe-user-metadata-1-preferences.png (opens in a new tab)test.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
user-metadata, user-preferences, feature-flags, onboarding, iblai
npx claudepluginhub iblai/base --plugin iblai-vibe166 skills in this plugin
/iblai-api-agent-accessManage role-based access to an ibl.ai agent via the platform API — list role policies, search users/groups, and grant/revoke editor, chat, or analytics_viewer roles for users, groups, and emails. Use when controlling who can edit, chat with, or view analytics for an agent./iblai-api-agent-auditRead an ibl.ai agent's audit log via the platform API — a who-changed-what trail filterable by action, actor email, and date range. Read-only. Use when investigating configuration changes to an agent./iblai-api-agent-chatSet up live chat with a deployed ibl.ai agent by wiring the hosted iblai-api-agent-chat MCP server into the project (.mcp.json / claude mcp add) using the .env Api-Token and a chosen agent's unique id, or by signing in from claude.ai, ChatGPT or Claude Desktop with only the URL. Use to enable runtime conversations with an agent, and to list or disconnect the apps a user has connected. The actual chatting then happens through the MCP server's tools.Other plugins' skills for the same job