@indiegateway/vue
@indiegateway/vue
Vue 3 paywall for IndieGateway (native-crypto). Uses @indiegateway/client — talks only to your billing BFF.
Merchant guide: Getting Started · Frontend
<script setup lang="ts">
import { ref } from 'vue';
import { IndiePaywall } from '@indiegateway/vue';
import '@indiegateway/vue/style.css';
import { indieGatewayClient } from '@indiegateway/client';
const api = indieGatewayClient.createBillingApi({
request: async ({ method, path, body }) =>
fetch(`${import.meta.env.VITE_API_URL}${path}`, {
method,
credentials: 'include',
headers: {
Accept: 'application/json',
...(body !== undefined ? { 'Content-Type': 'application/json' } : {}),
},
body: body !== undefined ? JSON.stringify(body) : undefined,
}),
});
const open = ref(false);
</script>
<template>
<IndiePaywall
:api="api"
:get-user-id="() => userId"
:open="open"
:overlay="true"
:theme="{ accent: '#ea580c' }"
:get-benefits="(plan) => [`Plan ${plan.name}`]"
@paid="refreshMe"
@claimed="refreshMe"
@close="open = false"
/>
</template>
Trial UI: return trial from GET …/billing/payment-status (evaluateUserTrialStatus). Gift length comes from public-config.trial_policy (and plan name from gift_plan_key). Claim defaults to api.claimTrial(); @claimed fires after it succeeds. Optional :reason overrides checkout reason.
Built-in modal shell is always on. :overlay="true" (default) adds dim + blur; :overlay="false" keeps the modal without backdrop. Use :embedded="true" when you wrap the panel in your own modal.
Customize
| Level | How |
|---|---|
| Overlay | :overlay="true" (default dim/blur); :overlay="false" modal without backdrop |
| Embedded | :embedded="true" panel only for your own modal/drawer |
| Skeleton | :skeleton-benefit-count="2" to match your benefit lines (default 3) |
| Theme | :theme="{ accent, surface, radius, font }" or CSS --ig-* on .ig-paywall |
| Root class | pass rootClass to scope your CSS: .my-paywall .paywall-panel {...} |
| Selection | v-model:selected-plan-key to preselect / control the catalog card |
| Disabled plans | getPlanDisabled returns a reason string to disable a card |
| Session | sessionStore from createCheckoutSessionStore('your.app.key') |
| Slots | #header #plans #benefits #order-summary #network #payment #success |
| Gift | default api.claimTrial(); optional :on-claim-trial override; @claimed after success |
| Headless | useNativeCryptoCheckout + usePaywallConfig + usePaywallTrial (+ step components) |
Product-specific UX (usage-limit copy, upgrade-block reasons) stays in your app via props/slots.
Related Packages
Official TypeScript SDK for Lumen Accounting — central auth, organization manage...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.10 | ^3.5.0 | MIT | |
| 0.1.9 | ^3.5.0 | MIT | |
| 0.1.8 | ^3.5.0 | MIT | |
| 0.1.7 | ^3.5.0 | MIT | |
| 0.1.6 | ^3.5.0 | MIT | |
| 0.1.5 | ^3.5.0 | MIT | |
| 0.1.4 | ^3.5.0 | MIT | |
| 0.1.3 | ^3.5.0 | MIT | |
| 0.1.2 | ^3.5.0 | MIT | |
| 0.1.1 | ^3.5.0 | MIT | |
| 0.1.0 | ^3.5.0 | MIT |