Rendering the customer paywall can be achieved in 2 steps:
Set the customer ID, the customer ID can usually be retrieved after a customer signs-in or restores their session.
TypeScript
Copy
Ask AI
import { useStiggContext } from '@stigg/react-sdk'; function App() { const { stigg } = useStiggContext(); useEffect(() => { // After user sign in call to setCustomerId stigg.setCustomerId('customer-ID'); }) }
Use the Paywall to render the customer paywall.
React TSX
Copy
Ask AI
<Paywall highlightedPlanId="plan-id" onPlanSelected={({ plan, customer }) => { // Handle customer intention to subscribe to plan }}/>