Skip to content

About

vibe-agent fronts one agent for one platform on ibl.ai. A creator (the platform admin) points it at an agent built on os.ibl.ai, decides whether access is free or paid, and members sign in with SSO to chat.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

75 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ibl.ai

vibe-agent

One creator, one AI agent, one paywall.

A single-platform app on ibl.ai: users sign in with ibl.ai SSO and chat with one agent, and access to the chat is sold on the platform's own Stripe account. Built from iblai/vibe's vibe-starter template on the @iblai/iblai-js SDK.

Next.js TypeScript Tailwind CSS Claude Code Desktop & Mobile


What is vibe-agent

vibe-agent fronts one agent for one platform on ibl.ai. A creator (the platform admin) points it at an agent built on os.ibl.ai, decides whether access is free or paid, and members sign in with SSO to chat. Two kinds of users: platform admins (the creator and their staff) see Analytics in Admin mode and answer the setup wizard (platform, agent, name, price); everyone else signs in on login.iblai.app (an account is made there in a minute) and lands in the chat as a member. When the admin chose a fee, the first message a member sends opens a pay modal; paying on the creator's own Stripe Checkout unlocks the agent. Everything is the SDK's — the shell, the chat, the analytics, the profile and account panels — connected to iblai.app.

Screenshots

Screen
Chat, with the canvas open Chat with the agent, canvas open
Analytics · Users Analytics — Users

Features

Feature Description
Chat / — the SDK Chat with the one agent (NEXT_PUBLIC_DEFAULT_AGENT_ID, the uuid at the end of its os.ibl.ai URL): streaming, sessions, files, voice. Anyone signed in can open it; when the admin chose a fee, sending needs a payment (platform admins excepted).
Sidebar The SDK PlatformSidebar — the shell the ibl.ai OS and LMS use — with this app's content: New chat, Recents (pinned chats first; each row can be pinned, unpinned or deleted) and, for admins in Admin mode, the Analytics menu. The bottom-left cluster is the SDK's: Notifications and Support for everyone, plus Invites, Management, Integrations, Monetization (when the platform sells credits) and Advanced for admins in Admin mode; the last four open the platform's account sheet in place. Collapses to an icon rail (Cmd/Ctrl+B), a drawer on phones.
Analytics /analytics/* — the OS analytics section for this one agent: Overview, Users, Topics, Transcripts, Memory, Costs, Audit, Data Reports (SDK AnalyticsLayout + stats components). Platform admins, in Admin mode.
Pay modal Opens when a member who has not paid sends a message: Stripe's own checkout form, rendered in the modal (Stripe.js, embedded) for a session the platform mints on the creator's Stripe account; when Stripe reports completion the platform verifies the payment and the message sends. The platform owns payments; free access never needs Stripe.
Setup /setup — one question: free access, one-time fee or monthly fee (USD). A paid answer connects your Stripe account with one click (Connect with Stripe: sign in on Stripe, nothing to copy) and the product and price are created for you on it. Opens itself for a platform admin until answered; reachable later from the quiet "Payments setup" link on /account.
User / Admin mode Platform admins get a User / Admin switch in the navbar (in the profile menu on narrow screens). User mode shows the app as a member sees it; Analytics and the admin cluster exist only in Admin mode. Starts on Admin, resets on reload.
Profile /profile — the SDK Profile panel, from the profile dropdown.
Account /account — the SDK Account panel (organization settings), admins.
Notifications /notifications — the SDK notification centre, from the bell.
About /about — off by default; NEXT_PUBLIC_SHOW_ABOUT=true enables it. The agent's public profile plus your copy (ABOUT_COPY in app/(app)/about/page.tsx).
Branding The logo in the sidebar header (and in the navbar on phones) is the org logo set in the platform's org settings, falling back to the ibl.ai mark.
SSO Login via iblai.app — no tokens to manage. Every origin the app runs on must be in the platform's allowed redirect origins.

Membership is free: anyone who signs in joins the platform. A payment is what unlocks sending, asked for in the modal, never on a page; platform admins never pay.

AGENTS.md / CLAUDE.md

AGENTS.md (with CLAUDE.md as its symlink) is the guide for agents and people changing this app: the map, the invariants and why, the paywall and setup end to end, and the gotchas learned building it. Read it before touching the shell, the paywall or the SDK wrappers.

Quick Start

Never used a terminal? Start with the tutorial: it goes from this page to a paying customer, with Claude doing every technical step.

Prerequisites

  • Node.js 20 or newer (22 is what this app is built with) and pnpm
  • Claude Code

Install & Run

Start Claude Code in the terminal (claude) and say:

get https://github.com/iblai/vibe-agent

It clones the repo, installs it and starts the dev server, then tells you to open http://localhost:3000 and press Start. The app asks the rest itself, in the browser: you sign in with your ibl.ai account, choose which platform is yours (never the shared main — that one is everyone's; no platform yet → Create your platform, right there, free), choose or create the agent this app fronts, name the app, and answer how people get in (free, one-time or monthly, and the price; a paid answer's next screen is one button, Connect with Stripe: sign in on Stripe and you are back). Claude asks for nothing but the name for the address and a Platform API Token when it publishes the app on ibl.ai hosting as <name>.vercel.app (os.ibl.ai → Integrations → APIs → Add API; it goes into iblai.env, for deploying, never repeated — the app itself holds no key). If it only clones, say follow AGENTS.md; or start inside the clone — git clone https://github.com/iblai/vibe-agent && cd vibe-agent && claude — and say run it.

By hand:

  1. Platform credentials go in iblai.env (gitignored):

    cp iblai.env.example iblai.env

    PLATFORM is your platform key (listed on https://login.iblai.app/me); TOKEN is a Platform API Token (os.ibl.ai → Integrations, in the sidebar's bottom cluster → APIs → Add API; the key is shown once).

  2. Install and run:

    pnpm install --ignore-scripts
    pnpm dev

    Open http://localhost:3000 and press Start. The app asks for the platform, the agent, the app's name and the access question, and keeps the answers itself — the platform, and a slug it mints with it (a uuid: how two apps on one platform keep their settings apart), in data/onboarding.json, its identity; the agent and the name in the platform's own metadata, so a published app can still change those. The platform is answered once, for good. The same save mints the Platform API Token that publishing needs, into iblai.env, so nothing is asked twice. There is no env file to create: every key has a default in lib/iblai/config.ts, and .env.example is a list of knobs (self-hosting URLs, the About flag) rather than a setup step. TOKEN never goes near the app: it holds no platform key.

    Every origin the app runs on (localhost and the deployed one) must be in the platform's allowed redirect origins, or sign-in never comes back.

Build

pnpm build
pnpm start

Paywall

Membership is free: every sign-in is login.iblai.app's join page for the platform, which makes the account or signs one in and links it to the platform (setup opens self-join on every answer). A payment is what unlocks the agent: when the admin chose a fee, a member's first message opens the pay modal (components/pay-gate.tsx, components/pay-modal.tsx) with Stripe's own checkout form inside it (Stripe.js, embedded). The platform (DM) owns every payment: the browser asks the platform, with the member's own sign-in token, for a Checkout Session on the creator's Stripe account; Stripe renders the form in the modal; the platform verifies the session, records payments and checks subscriptions live. No commission, no webhooks, no card details in this app, and no Stripe key or platform key anywhere in it — not even on its server. The app has the setup screen (app/setup, components/setup/setup-screen.tsx), the browser rail (lib/paywall-client.ts) and two admin routes under app/api/paywall/admin/ (setup, and the Connect with Stripe relay).

Who pays:

  • Platform admins never: sending is theirs.
  • A member who has not paid sees the modal on send while something is for sale; the message stays in the composer. Stripe's form is in the modal; when Stripe reports the payment complete the platform verifies the session on the member's own path and records it, and the send goes. Nothing leaves the page.
  • A payer whose subscription lapsed is caught within a minute of the next send: the platform's live check says the payment no longer grants, and the modal is back. Their membership stays.
  • A visitor without an account never sees a form of the app's own: / sends them to login.iblai.app's join page for the platform, which shows the app's name and the platform's description with the price after it, makes the account (or signs an existing one in) and links it to the platform; they come back a member. Not while the app is unfinished, though — until the wizard is answered a visitor with no session gets a calm "This app is being configured" page instead, and nobody is signed up into an app that cannot answer them yet.

The gate is the app's: the platform's chat API itself is open to every member, so the modal keeps honest users honest, not the determined.

Setup is one question, asked of a platform admin the first time they open the app (and reachable later from the quiet "Payments setup" link on /account):

  • Free access — anyone who signs in joins. No Stripe needed, ever.
  • One-time fee or Monthly fee — enter the price (USD). The first time, the button under the price reads Connect with Stripe: you sign in on Stripe (or create an account there), consent, and are back on /setup; the platform's own OAuth flow links your Stripe account to the platform. Nothing to copy, no key typed anywhere; payments go straight to that account, with no application fee. A platform whose admin pasted a stripe key in the OS never sees that button: that key wins over a connected account, and /setup says so. Disconnect and Reconnect are quiet links under Save; Reconnect switches Stripe accounts (or re-links the same one after revoking ibl.ai on Stripe): it disconnects, sends you through Connect with Stripe again, and a paid answer is re-saved on the new account.

For a paid answer, Save creates the Stripe product (named after the app, tagged metadata.app = NEXT_PUBLIC_PAYWALL_APP_SLUG) and the price on that account, retires the previous price if the answer changed, and records the choice in the platform's metadata under apps.<slug>. Free records the choice, touching Stripe not at all. Every answer also opens self-join (anyone who signs in is a member) and adds the price to the login branding — auth_web_mentorai, what login.iblai.app shows for the platform and its OS login too. Your own title and description are never edited: the price is appended to your description after a middle dot (and a price appended earlier is swapped, not stacked), and the app's name fills the title only when the platform has none — naming the app, on the agent step, writes that heading straight away, so a rename shows up on the sign-in page at once; a price left behind by a paid → free switch stays active on Stripe but is never sold, since the platform sells only the recorded one:

{
  "apps": {
    "vibe-agent": {
      "access": "monthly",
      "amount": 2900,
      "currency": "usd",
      "stripe": {
        "product_id": "prod_…",
        "price_id": "price_…",
        "publishable_key": "pk_…",
        "stripe_account": "acct_…"
      },
      "updated_at": "…"
    }
  }
}

That metadata is a public read on the platform, and everything in it is public by design: ids, amounts, the publishable key Stripe.js renders the form with (the platform's own on a connected account, yours on a pasted key) and the connected account id. Knowing them lets someone start paying you, nothing more. The browser reads it to know what is for sale; the platform enforces it: a checkout for any price but the recorded one is refused. The modal takes the live publishable key and account from the platform's checkout answer, not from the record. Free or unanswered means every member sends, without a platform call. Test with card 4242 4242 4242 4242. A cancellation is caught within about a minute of the payer's next send (the platform's cache, then the app's).

Headless alternative for admins, with DOMAIN, PLATFORM, TOKEN and IBLAI_USERNAME from iblai.env (the Platform API Token is the admin's own, for the terminal; the app never holds one). The proxy runs on whichever Stripe source the platform resolves: a pasted stripe credential, else the connected account:

STRIPE="https://api.$DOMAIN/dm/api/ai-mentor/orgs/$PLATFORM/users/$IBLAI_USERNAME/providers/stripe"
AUTH="Authorization: Api-Token $TOKEN"

curl -s -H "$AUTH" "$STRIPE/connect/"
# {"source": "connected" | "key" | null, …}: what payments run on right now

curl -s -H "$AUTH" "$STRIPE/payments/products/?limit=1"
# 200 working · 400 no Stripe source yet · 502 Stripe rejected the credential · 404 backend too old

curl -s -H "$AUTH" -H 'Content-Type: application/json' -X POST "$STRIPE/payments/products/" \
  -d '{"name":"vibe-agent access","metadata":{"app":"vibe-agent"}}'

curl -s -H "$AUTH" -H 'Content-Type: application/json' -X POST "$STRIPE/payments/prices/" \
  -d '{"product":"prod_…","unit_amount":2900,"currency":"usd","recurring":{"interval":"month"}}'
# drop "recurring" for a one-time price

curl -s -H "$AUTH" "$STRIPE/payments/paywall/payments/?app=vibe-agent"   # who paid so far

A price made this way is sold only once it is the recorded one (apps.vibe-agent.stripe.price_id, written with the metadata PUT) — or answer /setup, which does all of this.

Deployment

/iblai-vibe-ops-deploy (from iblai/vibe) zips the source, uploads it to ibl.ai hosting with the platform token, polls until ready and returns the live URL. It regenerates .env.production from .env.local, which this app does not have, so that file carries nothing — the identity rides in data/onboarding.json (the zip excludes by its own list, not .gitignore, and outputFileTracingIncludes puts the file in the function bundle; the published app keys the same apps.<slug>), the agent, the name and the paywall choice are in the platform's metadata, and the platform itself is what ibl.ai hosting recorded for the Vercel project: at boot the app asks the DM by VERCEL_PROJECT_ID (instrumentation.ts) and refuses to serve if that answer and the carried identity disagree. iblai.env, with the deploy token the wizard minted, never rides: the skill excludes it and the DM strips it. An app published before it was set up opens the wizard at the agent question on its own URL, keyed by its project id. Server mode is required: never set output: 'export'. Afterwards:

  • add the deployed origin to the platform's allowed redirect origins;
  • put it in src-tauri/tauri.conf.json → build.frontendDist (see below).

Native apps (Tauri v2)

src-tauri/ is a thin WebView shell: tauri dev loads http://localhost:3000 and release builds load build.frontendDist, the deployed origin. Nothing is bundled, so there is no static export and the paywall's server routes keep working. Until frontendDist holds a real URL it points at a .invalid host on purpose, so a forgotten value fails loudly instead of shipping a blank app.

Prerequisites: rustup, pnpm install --ignore-scripts, and nothing else on port 3000. Linux also needs libwebkit2gtk-4.1-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev; Windows needs the Visual Studio Build Tools C++ workload and WebView2; macOS needs xcode-select --install.

pnpm exec tauri icon path/to/logo.png   # every icon size from one square PNG (1024 px recommended)
pnpm exec tauri dev                     # desktop, this OS
pnpm exec tauri build                   # desktop release: .dmg/.app, .exe/.msi, .deb/.AppImage

iOS (macOS with Xcode):

rustup target add aarch64-apple-ios aarch64-apple-ios-sim
pnpm exec tauri ios init
pnpm exec tauri ios dev "iPhone 16 Pro Max"   # device names: xcrun simctl list devices
pnpm exec tauri ios build                     # .ipa under src-tauri/gen/apple/build/

Android (Android Studio with SDK and NDK):

rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
pnpm exec tauri android init
pnpm exec tauri android dev "Pixel_9"         # device names: adb devices
pnpm exec tauri android build                 # APK; add --aab for the Play Store

Mobile SSO cannot return from an https:// page into a native app, so it comes back through the custom scheme: TAURI_CUSTOM_SCHEME=vibe-agent in iblai.env, mapped to NEXT_PUBLIC_TAURI_CUSTOM_SCHEME in the deployed env.

Signed desktop releases: copy desktop-signing.env.example to desktop-signing.env, then make -f desktop-release.mk macos-dmg (signed and notarized universal DMG) or make -f desktop-release.mk windows-nsis. .github/workflows/tauri-build-desktop.yml builds unsigned macOS, Windows and Linux artifacts on demand (Actions → Run workflow). The signed release workflows that trigger on app-v* tags are in /iblai-vibe-ops-build's assets/tauri/workflows/.

Stores: /iblai-vibe-ops-release generates a Makefile and Fastlane config (make ios-release, make android-release); /iblai-vibe-windows-msix packages an MSIX for the Microsoft Store. A binary locked to one platform: IBL_TENANT=<key> pnpm exec tauri build.

Releases

Releases are automated with release-it, the way the OS does it. Every push to main runs .github/workflows/release.yml: it reads the conventional commit subjects since the last tag, bumps the version in package.json (feat: minor, fix: patch, a ! or a BREAKING CHANGE footer major, anything else patch), prepends the entries to CHANGELOG.md, commits chore(release): vX.Y.Z, tags vX.Y.Z and publishes a GitHub Release with the same notes. The release commit is skipped by the workflow, so there is no loop. Only typed subjects reach the changelog, which is what the commitlint hook in .husky/commit-msg enforces. The first release, made while no v* tag exists, is 1.0.0.

Nothing to configure: the job releases with the built-in GITHUB_TOKEN, so the release commit, the tag and the GitHub Release show as github-actions[bot]. Pushes made with that token never trigger other workflows; a workflow that must run on the v* tag would need a personal access token instead, as the OS uses.

Never edit CHANGELOG.md or the package.json version by hand. pnpm release is for CI; locally use pnpm release --dry-run --git.pushRepo=<remote> to preview (release-it expects origin). The desktop shell is versioned on its own: src-tauri/tauri.conf.json is set by hand and built on demand, see above.

Testing

Command Does
pnpm dev, pnpm build, pnpm start Next.js with Turbopack. next build type-checks with the project-local TypeScript 7 tsc
pnpm typecheck oxlint --type-check (tsgo diagnostics)
pnpm lint, pnpm check oxlint --type-aware; lint plus typecheck
pnpm fmt, pnpm fmt:check oxfmt
pnpm test vitest (config, source paths, platform resolution, paywall helpers, platform-metadata store, the browser paywall rail, route handlers, chat-row labels)
pnpm test:e2e Playwright against real SSO (credentials in e2e/.env.development)

Run pnpm check, pnpm test and pnpm build before a pull request; pnpm test:e2e when you change a user journey.

TypeScript is installed twice on purpose: typescript is aliased to the TS 6 package (the JavaScript compiler API Next.js loads) and @typescript/native to TS 7, so tsc is the Go compiler and tsc6 the old one. That is the setup from vercel/next.js#95633; Next 16.3 runs the local tsc during next build by default (experimental.useTypeScriptCli, see node_modules/next/dist/docs).

Project Structure

app/
├── layout.tsx                          # Root layout — wraps everything in <IblaiProviders>
├── (app)/
│   ├── layout.tsx                      # Signed-in shell: SDK SidebarProvider + PlatformSidebar + navbar, one scroller
│   ├── page.tsx                        # Chat — SDK <Chat> inside the pay gate (?session= restores, ?new= starts fresh)
│   ├── analytics/                      # SDK <AnalyticsLayout> over eight pages
│   ├── about/  profile/  account/  notifications/[[...id]]/
├── setup/                              # The setup wizard (outside the shell, no navbar)
├── sso-login-complete/                 # SSO landing
└── api/
    ├── onboarding/                     # What the setup wizard writes: the platform (once) to data/onboarding.json and the deploy token to iblai.env, the agent and name to platform metadata
    └── paywall/admin/
        ├── setup/                      # Admin rail — forwards the admin's own platform token
        └── connect/                    # Connect with Stripe relay — same token; GET status, POST start, DELETE
components/
├── sidebar/                            # app-sidebar.tsx (PlatformSidebar wrapper), recent-chats.tsx, chat-row.tsx, flat-nav-row.tsx
├── navbar/                             # nav-bar.tsx, logo.tsx, user-profile-button.tsx, admin-mode-switch.tsx
├── setup/                              # start-screen.tsx (press Start), setup-screen.tsx (platform → agent and name → the question, whose paid answer connects Stripe)
├── loading-screen.tsx                  # The one loading / busy screen (OS look)
└── pay-gate.tsx  pay-modal.tsx         # The send gate around <Chat>, and the pay modal it opens (Stripe's embedded checkout)
lib/
├── onboarding.ts                       # Server-only: the identity file, data/onboarding.json (the platform and its slug — what metadata cannot hold)
├── deploy-token.ts                     # Server-only: mints the deploy token at the platform save, into iblai.env
├── onboarding-client.ts                # Browser side of the wizard: agents, the runtime env, ibl.ai's sign-up return
├── paywall.ts  paywall-admin.ts        # Server-only: the admin routes' plumbing, platform-metadata store, resolveSetup
├── paywall-client.ts                   # Browser side: the buyer rail straight to the platform (catalogue, checkout, access), setup and access checks
├── chat-rows.ts                        # Recents row labels
└── iblai/                              # config.ts (env), tenant.ts, admin-mode.tsx, auth-utils.ts, storage-service.ts
providers/iblai-providers.tsx           # initializeDataLayer + AuthProvider + TenantProvider + i18n
store/iblai-store.ts                    # Redux store (slice keys fixed by the SDK)
proxy.ts                                # CSP and the 404 for /about when the flag is off
instrumentation.ts                      # On the hosting: asks the DM which platform owns this Vercel project, once per server instance
src-tauri/                              # Thin WebView shell for desktop and mobile
.github/workflows/                      # release.yml (release-it on every push to main), tauri-build-desktop.yml (desktop bundles on demand)
.husky/commit-msg                       # commitlint

Built With

  • Next.js — App Router, Turbopack
  • @iblai/iblai-js — SDK for auth, the shell, chat, analytics, profile and account
  • Tailwind CSS — utility-first styling with ibl.ai design tokens
  • shadcn/ui — accessible UI primitives (base-nova)
  • Tauri v2 — native desktop and mobile shells
  • iblai.app — the platform: auth, agents, entitlement, analytics

Contributing

Setup

  1. Clone the repo
  2. Install dependencies: pnpm install --ignore-scripts
  3. pnpm husky once: the install skips prepare, so the commit-msg hook (commitlint) is not there otherwise
  4. Fill iblai.env (see Quick Start), then pnpm dev and press Start

Development Workflow

  1. Create a branch from main: git checkout -b feat/my-feature
  2. Make your changes; pnpm fmt the files you touched
  3. Run pnpm check, pnpm test and pnpm build
  4. Commit with a conventional subject (feat:, fix:, docs:, chore:… — commitlint checks it; it decides the next version and the changelog) and push your branch
  5. Open a pull request against main

Guidelines

  • Use ibl.ai SDK components first — do not build custom components when an SDK equivalent exists; shadcn/ui (pnpm dlx shadcn@latest add <component> -y) for everything else
  • Host SDK panels the way the OS does — full width, no card, the component's own background; read AGENTS.md before wrapping one
  • Do not override SDK styles — SDK components ship with their own styling
  • Never set output: 'export' — the paywall needs the server routes
  • The app holds no platform secret — no IBLAI_API_KEY, no Stripe key; the buyer's own token and the admin's own token are the only credentials it sends, and secrets never go into platform metadata (everything under apps.<slug> is public by design)
  • A new env key lands in .env.example with a code default and in this README in the same change; a new route lands with a test in __tests__/
  • Use pnpm as the package manager

Adding Features

Use the iblai/vibe skills with Claude Code:

/iblai-vibe-auth          # SSO authentication (already wired)
/iblai-vibe-agent-chat    # Agent chat (already wired)
/iblai-vibe-profile       # Profile page (already wired)
/iblai-vibe-account       # Account/org settings (already wired)
/iblai-vibe-analytics     # Analytics dashboard (already wired)
/iblai-vibe-notification  # Notification centre (already wired)
/iblai-vibe-invite        # Invite dialogs
/iblai-vibe-ops-deploy    # Deploy to ibl.ai hosting
/iblai-vibe-ops-build     # Desktop/mobile builds
/iblai-vibe-ops-upgrade   # Upgrade SDK and skills

See AGENTS.md for the full list and the component priority rules.

Resources

  • ibl.ai Documentation
  • Vibe — developer toolkit for building with ibl.ai
  • @iblai/mcp — MCP server for AI-assisted development
  • iblai-app-cli — CLI for scaffolding ibl.ai apps
  • ibl.ai/os — the open-source agent platform this app mirrors
  • HQ — sister app for org / profile / analytics management

Built with ibl.ai Vibe

About

vibe-agent fronts one agent for one platform on ibl.ai. A creator (the platform admin) points it at an agent built on os.ibl.ai, decides whether access is free or paid, and members sign in with SSO to chat.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages