Server-side vs JavaScript SDK
cent-ads also ships a JavaScript SDK for clients that need client-side rendering (single-page apps, sites without server templating, etc.). This page shows both side-by-side so you can pick the right tool for the job.
Recommended: server-side (this is what the rest of the demo uses)
{{-- in any Blade view --}}
@centad('article_inline', ['url' => url()->current()])
- ✅ Crawlable by all search engines
- ✅ Works without JavaScript
- ✅ Faster (no extra round-trips on the client)
- ✅ CSP-friendly
Alternative: JavaScript SDK
<script src="https://cent-ads.example/sdk.js"></script> <div data-centads-slot="article_inline"></div>
- ⚠️ Crawlers that don't execute JS won't see the ad
- ✅ Useful for SPAs and static sites
- ✅ Easier when you can't run server-side code
Rule of thumb: if you have a server-rendered page, use the
@centad Blade directive (or the language equivalent). Only fall back to the JS SDK when
you have no server template at all.