Logo Iblai Vibe Credit

Iblai Vibe Credit

Tổ chức
iblai
iblai-vibe-credit

Thêm tiện ích hiển thị số dư tín dụng ibl.ai.

Add to TypingMind

Tổng quan

Nhà phát hànhiblai
Kho mãvibe
Tên kỹ năngiblai-vibe-credit
Sao
229
Bản fork
8
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được iblai công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Iblai Vibe Credit trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/iblai/vibe/tree/main/skills/billing/iblai-vibe-credit
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Iblai Vibe Credit trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Iblai Vibe Credit ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Iblai Vibe Credit với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

/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

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Iblai Vibe Credit làm được gì?

Thêm tiện ích hiển thị số dư tín dụng ibl.ai.

Vì sao nên dùng Iblai Vibe Credit trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Iblai Vibe Credit là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Iblai Vibe Credit trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/iblai/vibe/tree/main/skills/billing/iblai-vibe-credit. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Iblai Vibe Credit?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Iblai Vibe Credit với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Iblai Vibe Credit với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Iblai Vibe Credit có miễn phí không?

Có. Kỹ năng này được iblai phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇