0.0.40 • Published 10 months ago

renovi-utils v0.0.40

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

Renovi Utility Functions

Renovi Utility Functions is an 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-utils

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[];
}

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'],
};

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[];
}

Development

To build the package, run:

npm run build

To start the package, run:

npm run start

License

This project is licensed under the MIT License.

0.0.40

10 months ago

0.0.39

10 months ago

0.0.38

10 months ago

0.0.37

10 months ago

0.0.36

10 months ago

0.0.35

10 months ago

0.0.34

10 months ago

0.0.33

10 months ago

0.0.32

10 months ago

0.0.31

10 months ago

0.0.30

10 months ago

0.0.29

10 months ago

0.0.28

10 months ago

0.0.27

10 months ago

0.0.26

10 months ago

0.0.25

10 months ago

0.0.24

10 months ago

0.0.23

10 months ago

0.0.22

10 months ago

0.0.21

10 months ago

0.0.20

10 months ago

0.0.19

10 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago