@stigg/vue-sdk
@stigg/vue-sdk
Stigg SDK for Vue 3 applications.
Table of contents
Installation
Using npm
npm install @stigg/vue-sdk
Using yarn
yarn add @stigg/vue-sdk
Getting Started
Configure the SDK by wrapping your application in StiggProvider:
<script setup lang="ts">
import { StiggProvider, StiggProviderProps } from '@stigg/vue-sdk';
const stiggProvider: StiggProviderProps = {
apiKey: "<STIGG_CLIENT_API_KEY>",
};
</script>
<template>
<StiggProvider v-bind="stiggProvider">
<NestedComponents />
</StiggProvider>
</template>
Or in a context of a specific customer:
<script setup lang="ts">
import { StiggProvider, StiggProviderProps } from '@stigg/vue-sdk';
const stiggProvider: StiggProviderProps = {
apiKey: "<STIGG_CLIENT_API_KEY>",
customerId: "<CUSTOMER_ID>",
};
</script>
<template>
<StiggProvider v-bind="stiggProvider">
<NestedComponents />
</StiggProvider>
</template>
Paywall
Use Paywall component to render the public pricing page or customer paywall:
<script setup lang="ts">
import { Paywall, PaywallProps } from '@stigg/vue-sdk';
const paywall: PaywallProps = {
onPlanSelected: ({plan}) => {
console.log(`Selected plan: ${plan.displayName}`);
}
};
</script>
<template>
<Paywall v-bind="paywall" />
</template>
Customer Portal
Use the Customer Portal component to provide customers with visibility to their current subscription details:
<script setup lang="ts">
import { CustomerPortal, CustomerPortalProps, Paywall, PaywallProps } from '@stigg/vue-sdk';
const customerPortal: CustomerPortalProps = {
onManageSubscription: () => {
console.log('Manage subscription');
}
};
const paywall: PaywallProps = {
onPlanSelected: ({plan}) => {
console.log(`Selected plan: ${plan.displayName}`);
}
};
</script>
<template>
<CustomerPortal v-bind="customerPortal">
<template v-slot:paywall-component>
<Paywall v-bind="paywall" />
</template>
</CustomerPortal>
</template>
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 8.0.0 | ||
| 7.0.0 | ||
| 6.5.0 | ||
| 6.4.0 | ||
| 6.3.0 | ||
| 6.2.0 | ||
| 6.1.0 | ||
| 6.0.0 | ||
| 5.15.0 | ||
| 5.14.0 | ||
| 5.13.0 | ||
| 5.12.0 | ||
| 5.11.0 | ||
| 5.10.0 | ||
| 5.9.0 | ||
| 5.8.0 | ||
| 5.7.0 | ||
| 5.6.0 | ||
| 5.5.1 | ||
| 5.4.0 | ||
| 5.3.0 | ||
| 5.2.0 | ||
| 5.1.0 | ||
| 5.0.0 | ||
| 4.16.0 | ||
| 4.15.0 | ||
| 4.14.0 | ||
| 4.13.0 | ||
| 4.12.0 | ||
| 4.11.0 |
Showing the latest 30 of 98. See every release on npm