GithubHelp home page GithubHelp logo

hartl3y94 / amazon-advertising-api-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scaleleap/amazon-advertising-api-sdk

0.0 0.0 0.0 3.98 MB

Amazon Advertising API TypeScript and Node.js Unofficial SDK

Home Page: https://npm.im/@scaleleap/amazon-advertising-api-sdk

License: MIT License

JavaScript 0.42% TypeScript 99.56% Shell 0.02%

amazon-advertising-api-sdk's Introduction

๐Ÿ“ฆ @scaleleap/amazon-advertising-api-sdk

NPM License GitHub Workflow Status Snyk Codecov Semantic Release FOSSA Status


Amazon Advertising API TypeScript and Node.js Unofficial SDK


Development and maintenance is sponsored by Scale Leap

Install

npm i -s @scaleleap/amazon-advertising-api-sdk

Documentation

Usage

OAuth Client

Inherits from, and implements similar interface to client-oauth2 package.

import { OAuthClient } from '@scaleleap/amazon-advertising-api-sdk'

const client = new OAuthClient({
  clientId: '...',
  clientSecret: '...',
  redirectUri: '...',
})

// get redirect URL to send the user to start OAuth flow
const uri = client.getUri()

// get token
const token = client.getToken()

// refresh existing token
const token = client.createToken('... access token ...', '... refresh token ...')
const res = await token.refresh()

API Operations

The library is split into "operations", which are closely mapped to the operations (sections) of the API.

import { HttpClient, OperationProvider, ProfileOperation } from '@scaleleap/amazon-advertising-api-sdk'

// HTTP Client, tailored for the Amazon Advertising API
// See other endpoints: https://advertising.amazon.com/API/docs/en-us/get-started/how-to-use-api
const httpClient = new HttpClient('https://advertising-api.amazon.com', auth)

// A provider instance, that knows how to instantiate operation classes
const operationProvider = new OperationProvider(httpClient)

// Instantiate an "operation" object
const profileOperation = operationProvider.create(ProfileOperation)

// Using the operation object to make API calls
const res = await profileOperation.listProfiles()

Authors or Acknowledgments

License

This project is licensed under the MIT License.

FOSSA Status

amazon-advertising-api-sdk's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar fossabot avatar justinemmanuelmercado avatar moltar avatar nguyentoanit avatar renovate-bot avatar snyk-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.