panna-subscription-module
v1.0.3
Published
A React package for managing subscriptions with Stripe integration. This package provides `AppProvider` and `SubscriptionApp` components to simplify subscription management.
Readme
panna-subscription-module
A React package for managing subscriptions with Stripe integration. This package provides AppProvider and SubscriptionApp components to simplify subscription management.
Installation
Install the package via npm:
npm install panna-subscription-moduleUsage
Below is an example of how to use the panna-subscription-module in your React application:
import { AppProvider, SubscriptionApp } from "panna-subscription-module";
const App = () => {
return (
<AppProvider>
<SubscriptionApp
domainUrl={API_BASE_URL}
signerData={signerData}
stripeKey={process.env.REACT_APP_TEST_STRIPE_PUBLIC_KEY}
/>
</AppProvider>
);
};
export default App;Props for SubscriptionApp
| Prop Name | Type | Required | Description |
| ------------ | -------- | -------- | ----------------------------------------------------------- |
| domainUrl | string | Yes | The base URL of your API server that handles subscriptions. |
| signerData | object | Yes | An object containing signer information (e.g., email). |
| stripeKey | string | Yes | Your Stripe public key for processing payments. |
Environment Variables
Make sure to set the following environment variable in your .env file:
REACT_APP_TEST_STRIPE_PUBLIC_KEY=your-stripe-public-key