Installation
Basic setup
1
Create a reusable AdSlot component
2
Set your Site ID in the environment
3
Use the component anywhere
React Router — handling navigation
When using React Router, ads need to be re-initialized on each route change. Add anAdXensorProvider at the router root:
Initializing once at app level
If you want a single initialization point instead of one per slot, use a top-level effect:AdSense-style push
If you prefer the AdSense push pattern, use thepush() method instead:
Lazy loading per slot
Lazy loading is enabled by default — each slot loads when it enters the viewport. Disable it per slot if needed:Environment variable reference
TypeScript support
The SDK ships full type declarations. All props and config options are typed:Troubleshooting
→ Full troubleshooting guide