Install
Add the browser SDK.
index.html
// Web SDK script <script src="https://pro.adswedmedia.com/sdk.js" defer></script>
Use the Web SDK when you want JavaScript control over web placements while keeping the same site key, user id and S2S reward contract.
// Web SDK script <script src="https://pro.adswedmedia.com/sdk.js" defer></script>
// Initialize Web SDK const adswed=new Adswed({ siteKey:"{site_key}", userId:"{user_id}" });
Use the same client to render the surfaces enabled for your site.
// Render supported surfaces adswed.show("offerwall"); adswed.show("banners"); adswed.show("surveys"); adswed.show("ptc");
Client events are useful for UI state. Use S2S postbacks for final reward settlement.
// Listen for Web SDK events adswed.on("open", function(event) { console.log(event); }); adswed.on("close", function(event) { console.log(event); });
The Web SDK can open and track the browser surface. Your server should still verify credit, reject and chargeback events through the HMAC postback contract.