bl-lightning-sdk

1.3.2 • Public • Published

BrightLine Lightning JS SDK

Getting started

Before you follow the steps below, make sure you have the

Lightning-CLI installed globally only your system

npm install -g @lightningjs/cli

Link the SDK to the App by running

npm link

Import

import BLAd from 'bl-lightning-sdk'

Release notes

- Added FocusableList component
- Added DynamicComponent component
- Added conversion v2 creative component
- Added Timeouts for requests
- Added XHR instead of fetch

- Fixed some issues with wrong values in analytics
- Fixed bugs on Geo location

- Modularized creatives into their respective components
- Dynamic carousel and trivia logic now uses FocusableList component

- Removed _template() methods 
- Removed unused, commented or duplicated code

Example

const BLdataUrl =
  '//....../lightning.json'

const advertiserInfo = {
  configId: '1018',
  applicationName: 'THIS IS YOUR APP NAME',
  advertisingIdentifier: 'YOU NEED TO GENERATE THIS IF APPLICABLE',
  applicationVersion: 'YOU-POPULATE-THIS',
  deviceName: 'YOU NEED TO POPULATE THIS',
}

export default class App extends Lightning.Component {
  static _template() {
    return {
      w: 1920,
      h: 1080,
      BLAd: {
        type: BLAd,
        alpha: 0,
      },
    }
  }

  _init() {
    // pass the advertiserInfo
    this.tag('BLAd').BL_client(advertiserInfo)

    // initialize the ad with
    this.tag('BLAd').BL_init(BLdataUrl)

    //
    // destroy the ad with
    this.tag("BLAd").destroyAd();
  }
}

Readme

Keywords

Package Sidebar

Install

npm i bl-lightning-sdk

Weekly Downloads

96

Version

1.3.2

License

ISC

Unpacked Size

223 kB

Total Files

18

Last publish

Collaborators

  • brightline