@rough/rx-google-ad-manager-api

A rough implementation of rxified Google Ad Manager API client

Usage no npm install needed!

<script type="module">
  import roughRxGoogleAdManagerApi from 'https://cdn.skypack.dev/@rough/rx-google-ad-manager-api';
</script>

README

Rx Google Ad Manager API

Build Status npm version

A rough implementation of rxified Google Ad Manager API client

Getting started

Installation

$ npm i @rough/rx-google-ad-manager-api

Create a test network

const AdManager = require('@rough/rx-google-ad-manager-api');

const adManager = new AdManager({
  apiVersion: 'v201808',
  applicationName: 'my-app',
  jwtAuth: {
    client_email: 'me@example.com',
    private_key: '-----BEGIN PRIVATE KEY-----...',
    private_key_id: '...',
    project_id: 'my-project'
  }
});

adManager.api.NetworkService.makeTestNetwork().subscribe(
  result => console.log(result),
  err => console.log('ERROR' + err)
);

Get current user within a network

const AdManager = require('@rough/rx-google-ad-manager-api');

const adManager = new AdManager({
  apiVersion: 'v201808',
  applicationName: 'my-app',
  networkCode: '01234567890',
  jwtAuth: {
    client_email: 'me@example.com',
    private_key: '-----BEGIN PRIVATE KEY-----...',
    private_key_id: '...',
    project_id: 'my-project'
  }
});

adManager.api.UserService.getCurrentUser().subscribe(
  result => console.log(result),
  err => console.log('ERROR' + err)
);