1.1.2 • Published 9 months ago

renovi-websdk v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Renovi WebSDK Functions

Renovi WebSDK functions is a npm package that provides a set of utility functions for interacting with the Renovi API. This package includes functions for fetching campaigns, registering impressions, and initializing the package with a configuration object.

Installation

To install the package, run:

npm install renovi-websdk

Usage

To use this package, you need to provide a configuration object when initializing it. The configuration object should have the following structure:

interface IConfig {
apiKey: string;
email: string;
gameId: string;
panelNames: string[];
prod?: boolean;
}

Example

Here is an example of how to use the package:

import { initialize, getCampaigns, view } from 'renovi-utils';

const config = {
apiKey: 'your-api-key',
email: 'your-email@example.com',
gameId: 'your-game-id',
panelNames: ['Panel 1', 'Panel 2'],
prod: true //for produciotn
};

initialize(config).then(() => {
console.log('Package initialized successfully');

Fetch campaigns

   getCampaigns().then((campaigns) => {
       console.log('Campaigns:', campaigns);
   }).catch((error) => {
       console.error('Failed to fetch campaigns:', error);
   });

Register an impression

   view('Panel 1', 'https://example.com/view').then(() => {
       console.log('Impression registered successfully');
   }).catch((error) => {
       console.error('Failed to register impression:', error);
   });

}).catch((error) => {
console.error('Failed to initialize package:', error);
});

Functions

init(config: IConfig): Promise<void>

Initializes the package with the provided configuration object. This function must be called before using any other functions in the package.

getCampaigns(): Promise<IPrebidAds[]>

Fetches the list of campaigns from the Renovi API.

view(panelName: string, viewUrl: string): Promise<void>

Registers an impression for the specified panel and URL.

Types

IConfig

The configuration object used to initialize the package.

interface IConfig {
    apiKey: string;
    email: string;
    gameId: string;
    panelNames: string[];
    prod?: boolean;
}

License

This project is licensed under the MIT License.

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago