شعار Iblai Vibe Monetization App Paywall

Iblai Vibe Monetization App Paywall

مؤسسة
iblai
iblai-vibe-monetization-app-paywall

Put a Stripe "pay to enter" gate on a whole app on the organization's OWN Stripe account — Connect with Stripe (OAuth) or a pasted restricted key — through the DM paywall endpoints; no Stripe Connect Express, no commission, no webhooks, no platform key in the app. Installs /paywall/setup, where the admin answers free / one-time / monthly (USD) and connects Stripe (the agent never touches Stripe or a key), the PaywallGate, the /paywall page with Stripe's embedded checkout in a modal, and two admin routes that forward the admin's own token. Use when the user mentions charging for the whole app, pay to enter, app paywall, subscribe to use the app, gating the app behind payment, Connect with Stripe, paywall setup, or selling access with their own Stripe account. See /iblai-vibe-monetization for the item-level Connect family, /iblai-vibe-monetization-checkout for selling items in-platform, /iblai-vibe-ops-deploy for the server env, /iblai-vibe-auth for token wiring.

نظرة عامة

الناشرiblai
المستودعvibe
اسم المهارةiblai-vibe-monetization-app-paywall
النجوم
229
التفريعات
8
الملفات المرفقة
2
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 2

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها iblai على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Iblai Vibe Monetization App Paywall في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/iblai/vibe/tree/main/skills/monetization/iblai-vibe-monetization-app-paywall
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

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/monetization/iblai-vibe-monetization-app-paywall .claude/skills/iblai-vibe-monetization-app-paywall
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Iblai Vibe Monetization App Paywall في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Iblai Vibe Monetization App Paywall تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Iblai Vibe Monetization App Paywall بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

/iblai-vibe-monetization-app-paywall

Gate a whole app behind a one-time or monthly payment on the organization's own Stripe account — linked with Connect with Stripe (the admin signs in on Stripe; the platform stores only the account id and drives it with ibl.ai's key plus a Stripe-Account header) or by a pasted restricted key. The admin answers one question in the app, at /paywall/setup — free, a one-time fee or a monthly fee, in USD — and connects Stripe there; the agent never touches Stripe. The ibl.ai platform (DM) owns entitlement end to end: it mints every Checkout Session, verifies the buyer's session read-after-write, records payments durably, caches answers (grants 60 s, denies 15 s — a session_id punches through a cached deny), checks subscriptions live, and keeps recorded payers in during a Stripe outage. The app holds no platform key for any of it: members pay on their own session token, and the two admin routes forward the admin's own. No cookies, no webhooks, no local payment ledger. It is the model of ibl.ai's vibe-agent reference app, gated at the door instead of at the first message.

How a visit flows, after AuthProvider has signed the visitor in:

  • An organization admin goes straight in. While the paywall question is unanswered, PaywallGate takes them to /paywall/setup — once per session, from whatever page they opened.
  • A member goes in without a Stripe call while nothing is for sale (free, or not answered yet). Otherwise the platform's verdict lets them in, or sends them to /paywall → Continue to payment → Stripe's form in a modal → paid → the app.

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

This rail vs the Connect family

This skill (direct rail)/iblai-vibe-monetization-checkout (Connect rail)
SellsEntry to the whole appIndividual items (agents, courses…) in-platform
Stripe accountOrganization's own: a Standard account linked with Connect with Stripe (OAuth), or a pasted restricted key (rk_…)Stripe Connect Express, ibl.ai-managed
CommissionNoneibl.ai commission on each sale
ReconciliationDM records + live checks, no webhooksWebhook-reconciled subscriptions
Platform flagNone requiredenable_monetization

Selling items inside the app instead? Use the Connect family — start at /iblai-vibe-monetization.

Prerequisites

  • A scaffolded vibe-starter app with working SSO auth, in server mode: next.config.* must NOT set output: 'export' — the two admin routes are route handlers.
  • iblai.env with PLATFORM + TOKEN, for the probes below and — on an upgrade — reading the old setup. IBLAI_USERNAME comes from the environment (the ibl.ai desktop app exports it) or from iblai.env; if neither has it, ask the user once and persist it (same Step 1 as /iblai-vibe-ops-deploy).
  • Members' own checkout needs the Students role's Ibl.Mentor/StripePaywallSelf/action: organizations seeded before it existed need an ibl.ai operator to run seed_rbac_data, or every member meets the platform's 403 at the gate.
  • The agent never asks for or accepts a Stripe key in chat, and never creates Stripe products or prices: the admin's setup page does it.

Step 1: Install (once per app)

Read iblai.env with the val() reader (do not source it) and resolve IBLAI_USERNAME (env → iblai.env → ask once; both exactly as in /iblai-vibe-ops-deploy Step 1), then:

bash
DM="https://api.$DOMAIN/dm"; AUTH="Authorization: Api-Token $TOKEN"
PAY="$DM/api/ai-mentor/orgs/$PLATFORM/users/$IBLAI_USERNAME/providers/stripe/payments"
CONNECT="$DM/api/ai-mentor/orgs/$PLATFORM/users/$IBLAI_USERNAME/providers/stripe/connect/"
META="$DM/api/core/orgs/$PLATFORM/metadata/"
  1. Probe the backend. GET $PAY/paywall/access/?app=probe → a 404 means the platform predates the paywall endpoints (ibl-dm-pro PR #2977); GET $CONNECT → a 404 means it predates Connect with Stripe and the member rail (ibl-dm-pro 4.377.0). Either way stop and tell the user — nothing app-side can work around it. available: false on $CONNECT means a new connect cannot start yet (an operator issue); a pasted key still works.

  2. Upgrading from the previous release (the app has app/api/paywall/checkout/, or PAYWALL_PRICE_IDS in .env.local)? Do Upgrading first.

  3. Copy the files — ready-made, typecheck- and unit-test-gated copies ship as ops-init assets (same resolution as vibe-starter itself):

    bash
    cp -a <skills-dir>/iblai-vibe-ops-init/assets/stripe-components/. .

    If the staged skills carry no assets/ (some installers strip them), fall back to the drop-in bodies in references/app-files.md — identical content.

  4. Pin the slug — append to .env.local:

    bash
    NEXT_PUBLIC_PAYWALL_APP_SLUG=my-app   # the lowercased package name: letters, digits, - or _, ≤ 64

    It keys the choice under apps.<slug> in the organization's metadata, tags the Stripe product (metadata.app), and names the app on every checkout — and the platform records payments under it. Never change it afterwards: a new value strands everyone who paid. It has no default on purpose: two apps on one organization must never share one.

  5. Make the three edits (references/app-files.md shows each in full):

    • app/(app)/layout.tsx — wrap {children} in <PaywallGate> (from @/components/paywall-gate).

    • middleware.ts (or proxy.ts) — let Stripe's embedded checkout load. The SDK's default policy allows js.stripe.com but not checkout.stripe.com, so without this the form never renders on a production build:

      ts
      return applyCsp(request, {
        requestHeaders,
        mode: process.env.NODE_ENV === 'development' ? 'report-only' : undefined,
        // Stripe's embedded checkout (the paywall's pay modal).
        scriptSrc: ['https://checkout.stripe.com'],
        connectSrc: ['https://checkout.stripe.com'],
        frameSrc: ['https://checkout.stripe.com'],
        imgSrc: ['https://*.stripe.com'],
      });
    • app/(app)/account/page.tsx — the quiet Payments setup link for admins, the way back to the question: nothing new in the navbar.

  6. pnpm typecheck && pnpm test — the copy brings __tests__/paywall*.test.ts.

FileRole~Lines
lib/paywall-client.tsBrowser rail on the member's own token: the catalogue from public metadata, embedded checkout, access check, the setup check, the admin's texts361
lib/paywall.tsServer helpers for the admin routes: identity from the admin's own token, the Stripe proxy and Connect calls on their own path, the metadata record217
app/api/paywall/admin/setup/route.tsThe whole setup in one call: source check → retire the old price → product (tagged) → price → record; free records only156
app/api/paywall/admin/connect/route.tsConnect with Stripe relay: GET / POST / DELETE, statuses verbatim44
components/paywall-gate.tsxThe gate around (app): admins in (and to setup while unanswered), members by the platform's verdict71
components/paywall-setup.tsxThe setup screen: the question, whose paid answer's button is Connect with Stripe; reconnect, disconnect390
components/pay-modal.tsxStripe's embedded checkout in a modal, then the platform's confirmation169
app/paywall/page.tsxWhere unpaid members land: the price, Continue to payment, Restore access105
app/paywall/setup/page.tsxThe setup page, outside (app); Stripe returns to it12

Trust rules (non-negotiable):

  • Identity comes ONLY from the platform: the admin routes verify the caller's own token with core/token/verify/ — never a client-sent username — and the platform enforces the admin role on every call they forward.
  • No platform key and no Stripe secret in the app: never add IBLAI_API_KEY or a sk_/rk_ key to the paywall. Only ids, amounts and the publishable key go into the organization's metadata — a public read.
  • Surface the platform's 4xx bodies verbatim — they are actionable.

Upgrading from the previous release

The previous paywall sold through two Api-Token server routes, with the agent creating the Stripe objects and a PRICES constant on the page. In order:

  1. Read the old setup: PAYWALL_APP_SLUG from .env.local, GET $META (apps.<slug>.stripe) and GET $CONNECT (source, publishable_key).

  2. Stop if source is "key" and publishable_key is empty — apps that ran with PAYWALL_EMBEDDED=0. Checkout is embedded only now, so every buyer would be refused: have the admin add the account's publishable key (pk_…, a public value) to the organization's stripe credential on ibl.ai first.

  3. Remove what the new files replace — cp -a keeps old files, and these no longer compile:

    bash
    rm -rf app/api/paywall/checkout app/api/paywall/access app/paywall/return \
      app/paywall/paywall-actions.tsx components/paywall-connect.tsx \
      components/paywall-embedded.tsx lib/paywall-connect.ts __tests__/paywall-connect.test.ts
  4. Copy (Step 1, item 3), then set NEXT_PUBLIC_PAYWALL_APP_SLUG to the old PAYWALL_APP_SLUG — members who paid are recorded under it — and delete the PAYWALL_PRICE_IDS, PAYWALL_APP_SLUG and PAYWALL_EMBEDDED lines. IBLAI_API_KEY stays: other starter routes use it.

  5. The edits (Step 1, item 5); the layout one is already there.

  6. An app that sold several prices recorded none, and the admin's first save records one that binds every checkout, the old deployment's included — so have the admin answer /paywall/setup right before deploying the upgrade.

Existing payers keep their access as long as the slug is unchanged: the platform grants per member and app, not per price. A record the old skill wrote (stripe with no access) keeps selling its price until the admin answers, and the gate sends them to answer.

Step 2: Hand over the setup page

Send the admin to <app URL>/paywall/setup — locally http://localhost:3000/paywall/setup, on the port pnpm dev printed — not to the app's root; when you open the local preview, open that page. (The root works too: the gate sends an admin whose question is unanswered there. Name the page anyway.) There they:

  • choose Free access, a One-time fee or a Monthly fee, with the USD price;
  • for a paid answer while the organization has no Stripe source, the button reads Connect with Stripe — sign in on Stripe (or create an account there), consent, and they are back on /paywall/setup, where the answer saves itself.

Nothing is typed or copied, and nothing about Stripe goes through you. Say once that the quiet Payments setup link on /account reopens it: a later "change the price" or "make it free" is that page again, not you. The page refuses a paid plan while the Stripe source has no publishable key, naming the fix — and on a connected account says when Stripe has not enabled payments yet. Its reference — every call, the error reasons, and curl equivalents for scripted setup or debugging — is references/setup-api.md.

Step 3: Deploy

Server mode is required (no output: 'export'). /iblai-vibe-ops-deploy regenerates .env.production from .env.local and copies every NEXT_PUBLIC_* key; before uploading, confirm grep NEXT_PUBLIC_PAYWALL_APP_SLUG .env.production. The CSP edit (Step 1, item 5) is what lets Stripe's form render once deployed: pnpm dev only reports policy violations, a production build enforces them. Connect with Stripe's return_url is validated against the organization's own deployed apps (*.vercel.app hosts), its custom domains, and localhost — a 400 naming the host at Connect with Stripe means the app isn't deployed under this organization yet: deploy first, or attach the domain.

Step 4: Verify

  • As an admin with the question unanswered, opening / lands on /paywall/setup
  • Monthly $29 with no Stripe source → Connect with Stripe → Stripe → back on /paywall/setup → saved → the app
  • GET $META shows apps.<slug> with access, amount, stripe.price_id and stripe.publishable_key
  • With a member account (admins never pay): / → /paywall with the price → Continue to payment → Stripe's form in the modal → test card 4242 4242 4242 4242 → the app
  • The same on a production build (pnpm build && pnpm start) or the deployed host — the only place the CSP is enforced
  • A second unpaid member is held on /paywall; Restore access reports no payment found
  • GET $PAY/paywall/payments/?app=<slug> lists the test payment
  • Free: members go straight in, and no Stripe call is made
  • Subscription only: cancel in the Stripe dashboard → access lapses within ~75 s (platform cache) plus up to 60 s held in the page

Deliberately not built

  • Webhooks — the platform records at the buyer's return and re-checks live; there is nothing to receive.
  • Several prices per app — one question, one recorded price, and members can buy only that.
  • Hosted (redirect) checkout — the modal is the only checkout; the setup refuses a paid plan on a source with no publishable key, so a buy cannot fail on it.
  • Self-serve cancel UI — the admin cancels in their Stripe dashboard; access lapses within the cache window.
  • Refund auto-revoke — a recorded one-time payment is permanent entitlement by design.
  • Guest checkout — the app is login-first; anonymous buying belongs to the Connect rail.
  • Opening self-join and putting the price on the sign-in page — vibe-agent does both; they are organization-wide settings, and a starter app's organization may serve other apps.

Common mistakes

  • Putting /paywall or /paywall/setup inside (app) — the gate would loop, or bounce the admin who came to set it up. Both live outside it, inside the root providers.
  • Adding ^/paywall to PUBLIC_ROUTES — checkout needs a signed-in member; login-first is the design.
  • Skipping the CSP edit because it works under pnpm dev — dev only reports; once deployed, nobody can pay.
  • Changing NEXT_PUBLIC_PAYWALL_APP_SLUG after a sale, or giving two apps on one organization the same one — payments are recorded under the slug.
  • Testing the purchase as an admin — admins go straight in; use a member account.
  • Disconnecting Stripe while a paid plan is recorded — the platform checks every member's access on the Stripe source, so members who paid are locked out too until an account is linked again. To stop charging, choose Free access (the page asks before unlinking).
  • A member's 403 at the gate — the organization predates the member rail's permission (seed_rbac_data), or the browser's app_tenant names another organization than NEXT_PUBLIC_MAIN_TENANT_KEY: the platform refuses a token for one organization on another's path.
  • ?stripe_connect=error&reason=invalid_grant — Stripe refused the one-time code at the platform's exchange. Nothing the app sends reaches that exchange: a code spent twice, or — when it repeats — the ibl.ai instance's Connect credentials mixing test and live mode, which ibl.ai support fixes. A pasted restricted key plus its publishable key is the way round.
  • Creating products and prices with curls, or collecting a Stripe key — the setup page does it; the curls in references/setup-api.md are for CI and debugging only.
  • Expecting instant lockout after a subscription cancel — the window is the platform's cache (≤ ~75 s) plus up to 60 s held in the page.

Related skills

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Iblai Vibe Monetization App Paywall؟

Put a Stripe "pay to enter" gate on a whole app on the organization's OWN Stripe account — Connect with Stripe (OAuth) or a pasted restricted key — through the DM paywall endpoints; no Stripe Connect Express, no commission, no webhooks, no platform key in the app. Installs /paywall/setup, where the admin answers free / one-time / monthly (USD) and connects Stripe (the agent never touches Stripe or a key), the PaywallGate, the /paywall page with Stripe's embedded checkout in a modal, and two admin routes that forward the admin's own token. Use when the user mentions charging for the whole ap...

لماذا تستخدم Iblai Vibe Monetization App Paywall على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Iblai Vibe Monetization App Paywall عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Iblai Vibe Monetization App Paywall في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/iblai/vibe/tree/main/skills/monetization/iblai-vibe-monetization-app-paywall. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Iblai Vibe Monetization App Paywall؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Iblai Vibe Monetization App Paywall؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Iblai Vibe Monetization App Paywall معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Iblai Vibe Monetization App Paywall مجانية؟

نعم. نشرها iblai على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇