Logo van Iblai Vibe Credit

Iblai Vibe Credit

Organisatie
iblai
iblai-vibe-credit

Voeg de widget voor het ibl.ai-tegoed toe.

Add to TypingMind

Overzicht

Uitgeveriblai
Repositoryvibe
Skillnaamiblai-vibe-credit
Sterren
229
Forks
8
Meegeleverde bestanden
1
LicentieMIT
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 1

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door iblai op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Iblai Vibe Credit in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/iblai/vibe/tree/main/skills/billing/iblai-vibe-credit
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/iblai/vibe.git /tmp/vibe
mkdir -p .claude/skills
cp -r /tmp/vibe/skills/billing/iblai-vibe-credit .claude/skills/iblai-vibe-credit
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Iblai Vibe Credit in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Iblai Vibe Credit automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Iblai Vibe Credit niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

/iblai-vibe-credit

Add the ibl.ai credit balance widget to your app's top navigation. The widget shows the user's remaining credits, current plan, and exposes the upgrade / add-credits / manage-billing flows. It uses Stripe under the hood and is rendered by the SDK — do not build a custom version.

Credit Balance

Do NOT add custom styles, colors, or CSS overrides to the <CreditBalance> component. It ships with its own styling, including the trigger icon, the dropdown panel, and the upgrade/add-credits buttons. Wrapping it, restyling it, or swapping the icon will break the upgrade flow and visual consistency across ibl.ai apps.

The widget MUST follow the canonical integration:

  • Import path: @iblai/iblai-js/web-containers (the framework-agnostic bundle — NOT /next, NOT /sso)
  • redirectUrl: window.location.origin (the Stripe checkout return URL — origin only, never .href or a path)
  • enabled: explicit true
  • No className: do not pass a className prop unless you have a layout reason. Never use it to swap the icon, change colors, or override the size

Visual spec

PropertyValue
TriggerIcon-only button (Lucide CreditCard) provided by the SDK
Trigger sizeh-5 w-5 icon inside a ghost icon button
Status dotSmall colored dot in the top-right of the trigger when balance is low
Panel widthw-[320px] dropdown
Position in navbarRight side, between the page links and the notification bell

Prerequisites

  • Auth must be set up first (/iblai-vibe-auth)
  • Navbar must be in place (/iblai-vibe-navbar)
  • @iblai/iblai-js SDK installed
  • Tailwind v4 with the SDK @source directives configured (see Step 1 below)
  • The organization must have paywall enabled (currentTenant.show_paywall === true). The widget is a no-op for organizations that don't sell credits.

What this skill creates

This skill does not generate any new files — it wires <CreditBalance> from the SDK into the existing navbar. It adds:

  • A <CreditBalance> element inside the navbar's right-side cluster
  • The required @source directives in iblai-styles.css so Tailwind generates the SDK's internal classes (the trigger icon depends on this — without it, the icon may render at the wrong size)
  • The visibility gate so the widget only renders for users who can act on it (admins or trial users, on a paywall-enabled organization)

Step 1 — Confirm Tailwind scans both SDK source folders

The <CreditBalance> icon and panel use Tailwind utility classes authored inside the SDK's compiled JS. Tailwind v4 will not generate those classes unless the SDK's source/ directories are listed as @source.

Open app/iblai-styles.css (or app/globals.css if styles live there) and ensure BOTH directives are present:

css
@source "../node_modules/@iblai/iblai-js/dist/web-containers/source";
@source "../node_modules/@iblai/iblai-js/dist/web-containers/source/next";

If the app scans through a lib/iblai/sdk symlink instead (some older scaffolds ship one), the equivalent is:

css
@source "../lib/iblai/sdk/web-containers/source";
@source "../lib/iblai/sdk/web-containers/source/next";

Both lines are required. The source/next path covers the next-bundle classes; the SDK's icon and dropdown rely on classes from across the whole bundle. If only one is scanned, the credit icon may render at an unexpected size or without its layout utilities.

After editing, restart the dev server. Verify the build picks up the classes:

bash
rm -rf .next && pnpm build
grep -oE 'h-5\\!|w-5\\!' .next/static/chunks/*.css | head

You should see h-5\! and w-5\! in the generated CSS.


Step 2 — Import the component

Inside your navbar component (components/navbar/nav-bar.tsx or equivalent), import CreditBalance from the framework-agnostic bundle:

tsx
import {
  CreditBalance,
  NotificationDropdown,
} from '@iblai/iblai-js/web-containers';

Do NOT import from @iblai/iblai-js/web-containers/next. The credit component does not require Next.js primitives, and the /next bundle re-exports a smaller surface — keeping all SDK widgets on the same import path simplifies the component graph.


Step 3 — Render the widget

Place <CreditBalance> inside the navbar's right-side cluster, before the notification bell:

tsx
<div className="flex items-center space-x-4">
  {showCreditBalance &&
    currentTenant?.show_paywall &&
    canViewCredits &&
    isLoggedIn && (
      <CreditBalance
        tenant={tenantKey}
        enabled={true}
        redirectUrl={window.location.origin}
        mainPlatformKey={config.mainTenantKey()}
        currentUserEmail={email}
        username={username}
      />
    )}

  <NotificationDropdown
    org={tenantKey}
    userId={username ?? ''}
    isAdmin={isAdmin}
    onViewNotifications={handleViewNotifications}
  />

  {/* Profile dropdown last */}
</div>

Required props

PropSourceNotes
tenantResolved org key (e.g. from resolveAppTenant())The organization the user is acting under — billing is per-organization
enabledAlways trueThe component itself returns null if enabled is false; pass true so it renders when the gating below passes
redirectUrlwindow.location.originStripe checkout returns to this URL after success/cancel. Always use origin (not href or a path) so refreshes from Stripe land on a stable route
mainPlatformKeyconfig.mainTenantKey()The platform key from NEXT_PUBLIC_MAIN_TENANT_KEY — used by the upgrade flow to attribute revenue to the correct platform
currentUserEmailFrom userData in localStorage (user_email / email)Stripe Checkout pre-fills with this
usernameFrom userData (user_nicename / username)Used for the Stripe customer portal userId

Optional props

PropDefaultNotes
className(none)Reserved for layout adjustments only. Do NOT use it to override the icon, colors, or sizing
enabledtruePass false to programmatically hide the widget without unmounting it (rarely useful — prefer the gating below)

Step 4 — Gating

The widget MUST only render when ALL of the following are true:

  1. The tenant sells credits — currentTenant?.show_paywall === true. Organizations without paywall enabled return no billing info; rendering the widget there shows a permanent error state.
  2. The user can act on credits — typically isAdmin || userOnFreeTrial. Regular users on a paid plan generally cannot top up the organization's balance, so showing them the widget is misleading. Substitute the equivalent check for your app's role model.
  3. The user is logged in — the widget hits authenticated billing endpoints. Render only after auth has resolved (e.g. when tenantKey, username, and email are all populated from localStorage).

Pull these flags into the navbar component (or its parent layout) and combine them in the JSX guard shown in Step 3. Do not gate solely on enabled — the SDK's enabled prop hides the rendered output but does not skip the billing query, so a real visibility gate at the JSX level is required.


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. Then:

Start the dev server, log in, and confirm:

  1. The credit-card trigger icon appears between the navigation links and the notification bell on a paywall-enabled organization.
  2. Clicking the trigger opens the dropdown panel showing remaining credits, consumed credits, reset date (if applicable), and a billing pill.
  3. On a Free plan, the panel shows an "Upgrade Plan" CTA. After adding a payment method, the buttons switch to "Manage Usage" and "Add Credits".
  4. Clicking the upgrade or manage-billing button redirects to Stripe Checkout / the Stripe customer portal and returns to your app's origin on completion.

If the icon renders larger than h-5 w-5 or without its border-radius, the SDK source folders are not being scanned — go back to Step 1.


Common mistakes

  • Wrong import path: importing from @iblai/iblai-js/web-containers/next works for some bundles but ties the credit widget to Next-specific primitives unnecessarily. Use the plain web-containers path.
  • redirectUrl={window.location.href}: when Stripe Checkout succeeds, it redirects back to this URL. Using .href re-opens whatever modal or query state was active when the upgrade started, which can re-trigger the upgrade flow. Always use .origin.
  • Missing @source "../.../source/next": the most common cause of "the icon looks wrong" — Tailwind isn't generating the SDK's classes because only one of the two source paths is scanned.
  • Adding a className to swap icons or colors: don't. The component is a contract; downstream apps depend on it being visually consistent.
  • Rendering on tenants without paywall: the panel will show "Unable to load credit balance" indefinitely. Always gate on currentTenant?.show_paywall.
  • Rendering for non-admin / non-trial users: they cannot top up the org's balance, so the panel's actions are no-ops. Hide the widget for them.

SDK component reference

For the full prop surface and the underlying billing data shape, see:

  • CreditBalance — @iblai/iblai-js/web-containers
    • props: tenant, username, mainPlatformKey, currentUserEmail, redirectUrl, className?, enabled?
  • Billing data is fetched via useGetAccountBillingInfoQuery from the data layer — no manual data fetching is required
  • Stripe portal sessions are created via useCreateStripeCustomerPortalMutation

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Iblai Vibe Credit?

Voeg de widget voor het ibl.ai-tegoed toe.

Waarom Iblai Vibe Credit gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Iblai Vibe Credit bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Iblai Vibe Credit in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/iblai/vibe/tree/main/skills/billing/iblai-vibe-credit. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Iblai Vibe Credit gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Iblai Vibe Credit gebruiken?

Zoveel als je wilt. Je kunt Iblai Vibe Credit gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Iblai Vibe Credit gratis?

Ja. Deze skill is door iblai op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇