Initialization
✅ DO:- Initialize once per session, on app load
awaittheinit()result before fetching ads- Handle initialization errors before proceeding
- Store the
sdkinstance at module/app level
- Create multiple
VelocitySDKinstances - Call
init()inside render loops or ad-fetch functions - Ignore initialization errors
Ad Fetching
✅ DO:- Provide meaningful
promptandaiResponsevalues - Always check
ads.lengthbefore rendering - Specify accurate
dimensionsmatching your ad container
- Use empty or placeholder prompts
- Block UI during ad loading — fetch asynchronously
- Hardcode dimensions that don’t match your layout
Error Handling
Always handle both init and fetch errors to avoid silent failures:Ad Rendering
✅ DO:- Use
clickUrlto make the full ad clickable - Open ad links in a new tab with
rel="noopener noreferrer" - Display the top ad (
ads[0]) — ads are sorted by bid price
- Ignore
clickUrl— this is required for monetization - Render ads in iframes or sandboxed environments that block navigation
Configuration
Usetimeout and retries to handle slow networks gracefully:

