0.0.40 • Published 1 year ago

renovi-utils v0.0.40

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.0.39

1 year ago

0.0.38

1 year ago

0.0.37

1 year ago

0.0.36

1 year ago

0.0.35

1 year ago

0.0.34

1 year ago

0.0.33

1 year ago

0.0.32

1 year ago

0.0.31

1 year ago

0.0.30

1 year ago

0.0.29

1 year ago

0.0.28

1 year ago

0.0.27

1 year ago

0.0.26

1 year ago

0.0.25

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago