@stigg/vue-2-sdk

0.0.6 • Public • Published

@stigg/vue-2-sdk

Stigg SDK for Vue 2 applications.

Table of contents

Installation

Using npm

npm install @stigg/vue-2-sdk

Using yarn

yarn add @stigg/vue-2-sdk

Getting Started

Configure the SDK by wrapping your application in StiggProvider:

<script setup lang="ts">
import {StiggProvider} from '@stigg/vue-2-sdk';

const apiKey = "<STIGG_CLIENT_API_KEY>";
</script>

<template>
   <StiggProvider :apiKey="apiKey">
      <NestedComponents />
   </StiggProvider>
</template>

Paywall

Use Paywall component to render the public pricing page or customer paywall:

<script setup lang="ts">
import {StiggProvider, PaywallProps} from '@stigg/vue-2-sdk';

const apiKey = "<STIGG_CLIENT_API_KEY>";

const paywall: PaywallProps = {
   onPlanSelected: ({plan}) => {
      console.log(`Selected plan: ${plan.displayName}`);
   }
}
</script>

<template>
   <StiggProvider :apiKey="apiKey">
      <Paywall v-bind="paywall" />
   </StiggProvider>
</template>

Customer Portal

Use the Customer Portal component to provide customers with visibility to their current subscription details:

<script setup lang="ts">
import {StiggProvider, CustomerPortal, CustomerPortalProps} from '@stigg/vue-2-sdk';

const apiKey = "<STIGG_CLIENT_API_KEY>";

const customerId = "<CUSTOMER-ID>";

const customerPortal: CustomerPortalProps = {
   onManageSubscription: () => {
     console.log('Manage subscription');
   }
}
</script>

<template>
   <StiggProvider :apiKey="apiKey" :customer-id="customerId">
      <CustomerPortal v-bind="customerPortal"/>
   </StiggProvider>
</template>

Readme

Keywords

none

Package Sidebar

Install

npm i @stigg/vue-2-sdk

Weekly Downloads

0

Version

0.0.6

License

none

Unpacked Size

24 MB

Total Files

10

Last publish

Collaborators

  • guystigg
  • tom.peri
  • yelena-stigg
  • yt-stigg
  • nadavsho
  • alexfedin
  • mortal94
  • itzik.stigg
  • oratstigg
  • stiggnpc
  • nadavstigg
  • royyy
  • antonzy