@corrily/react-sdk
v0.1.0-alpha2
Published
React SDK for integrating a Corrily Paywalls into your website
Downloads
7
Keywords
Readme
@corrily/react-sdk
Corrily sdk library for react applications.
Installation
npm i @corrily/react-sdk
or with yarn
yarn add @corrily/react-sdk
Getting Started
import * as ReactDOM from 'react-dom/client';
// import styles into your app
import from '@corrily/react-sdk/dist/styles.css';
import App from './app/app';
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(<App />);
Use Paywall to display your products:
import { Paywall, CorrilyProvider } from '@corrily/react-sdk';
const App = () => {
const userId = '<USER_ID>';
const onProductSelected = (product) => {
console.log(product);
};
return (
<CorrilyProvider
apiKey={'<YOUR API_ID>'}
params={{
user_id: userId,
}}
>
<Paywall onPlanSelected={onProductSelected} />
</CorrilyProvider>
);
};