hypelab-sdk-clone
v5.0.0
Published
Grab the latest version of the SDK off of [NPM](https://www.npmjs.com/package/hypelab-sdk-clone):
Downloads
1
Readme
Installing the SDK
Grab the latest version of the SDK off of NPM:
npm install hypelab-sdk-clone
Initializing a client
// connect to HypeLab staging
let client = new HypeLabClone({
URL: 'https://hypelab-clone-server.onrender.com',
propertySlug: 'harshit-kumar-slug'
});
Showing an ad
First, you will need to create real estate on the DOM where you would like the ad to be positioned. This div
needs to have an id specified, which you will pass into the SDK.
<div id="ad-slot"></div>
import HypeLabClone from 'hypelab-sdk-clone';
const client = new HypeLabClone({
propertySlug: "harshit-kumar-slug",
URL: "https://hypelab-clone-server.onrender.com"
})
const adMetadata = {
headline: "This is a sample headline of the ad!",
content: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Perferendis, cumque consectetur perspiciatis nihil cupiditate autem corrupti eaque repellat consequatur quae sint natus eum rem ab nulla incidunt esse porro excepturi!",
imgUrl: "https://fastly.picsum.photos/id/299/200/300.jpg?hmac=iJwKPn_sm8S_ZGJttTHq5EpwaEESy8Q-qDaQ9xWtlYw",
imgWidth: "500px",
imgHeight: "300px"
}
client.showAd("ad-slot", adMetadata)