- Render ads on your site:
RevinelProvider+ hooks, on top of@revinel/sdk. - Acquire advertisers: the
<TierSelector>/<TierSelectorDialog>“Subscribe to advertise” widget.
Install
react (>=18) is a peer dependency.
Render ads
Wrap your app once, then read ads with the hooks:useTracking records a viewable impression (via IntersectionObserver) and wires click
tracking through getClickProps(). Use useAds({ count }) for a grid.
For a layout-persistent ad that never remounts on client-side navigation, impressions fire
only once per ad id. Pass resetKey set to a value that changes per page view (the current
pathname) to restore one impression per page view: useTracking(ad?.id, { resetKey: pathname }).
Tier selector (acquire advertisers)
Inline:useTiers() + useCheckout():
Exports
- Provider:
RevinelProvider,useRevinelClient - Ads:
useAd,useAds,useTracking - Tiers/checkout:
useTiers,useCheckout - Widgets:
TierSelector,TierSelectorDialog
RevinelAdOptions, RevinelQueryState, …)
so you can type wrappers around them.