@maxim_mazurok/gapi.client.poly
TypeScript icon, indicating that this package has built-in type declarations

1.0.20210817 • Public • Published

TypeScript typings for Poly API v1

The Poly API provides read access to assets hosted on poly.google.com to all, and upload access to poly.google.com for whitelisted accounts. For detailed description please check documentation.

Installing

Install typings for Poly API:

npm install @types/gapi.client.poly@v1 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load('poly', 'v1', () => {
  // now we can use gapi.client.poly
  // ...
});

After that you can use Poly API resources:

/*
Returns detailed information about an asset given its name. PRIVATE assets are returned only if the currently authenticated user (via OAuth token) is the author of the asset.
*/
await gapi.client.poly.assets.get({ name: "name",  });

/*
Lists all public, remixable assets. These are assets with an access level of PUBLIC and published under the CC-By license.
*/
await gapi.client.poly.assets.list({  });

Readme

Keywords

none

Package Sidebar

Install

npm i @maxim_mazurok/gapi.client.poly

Weekly Downloads

1

Version

1.0.20210817

License

MIT

Unpacked Size

25.8 kB

Total Files

6

Last publish

Collaborators

  • maxim_mazurok