hypelab-sdk-clone
TypeScript icon, indicating that this package has built-in type declarations

5.0.0 • Public • Published

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)

Readme

Keywords

none

Package Sidebar

Install

npm i hypelab-sdk-clone

Weekly Downloads

2

Version

5.0.0

License

ISC

Unpacked Size

9.3 kB

Total Files

10

Last publish

Collaborators

  • hkst11