React Quickstart
Install adkit-react and drop ad slots into your React app. Works with Vite, Create React App, and any React 17+ project.
Prerequisites
Install the package
Add the provider
Wrap your app with AdkitProvider and import the stylesheet. Place the provider as high in the tree as possible so all slots share the same context.
Place a slot
Import AdSlot and add it anywhere in your component tree. Give it a unique slot name and an aspect ratio.
Price is in cents
price={2500} displays as $25/day. The server confirms the final price — it cannot be overridden client-side.Verify it works
Run your dev server and open the page. The slot should match this banner placeholder.
Without a provider
If you only need a single isolated slot, pass siteId directly to AdSlot instead of using a provider.
refresh() API from useAdkit() is only available inside a provider. For SPA route changes, use the provider approach.