1.0.20220730 • Published 2 years ago

@maxim_mazurok/gapi.client.smartdevicemanagement v1.0.20220730

Weekly downloads
79
License
MIT
Repository
github
Last release
2 years ago

TypeScript typings for Smart Device Management API v1

Allow select enterprise partners to access, control, and manage Google and Nest devices programmatically. For detailed description please check documentation.

Installing

Install typings for Smart Device Management API:

npm install @types/gapi.client.smartdevicemanagement@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('smartdevicemanagement', 'v1', () => {
  // now we can use gapi.client.smartdevicemanagement
  // ...
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [ 
      // See and/or control the devices that you selected
      'https://www.googleapis.com/auth/sdm.service',

      // See and control the Nest thermostats that you select
      'https://www.googleapis.com/auth/sdm.thermostat.service',
    ],
    immediate = true;
// ...

gapi.auth.authorize(
  { client_id: client_id, scope: scope, immediate: immediate },
  authResult => {
    if (authResult && !authResult.error) {
        /* handle successful authorization */
    } else {
        /* handle authorization error */
    }
});

After that you can use Smart Device Management API resources:

1.0.20220612

2 years ago

1.0.20220622

2 years ago

1.0.20220703

2 years ago

1.0.20220708

2 years ago

1.0.20220718

2 years ago

1.0.20220606

2 years ago

1.0.20220722

2 years ago

1.0.20220730

2 years ago

1.0.20220429

2 years ago

1.0.20220511

2 years ago

1.0.20220513

2 years ago

1.0.20220522

2 years ago

1.0.20220602

2 years ago

1.0.20220415

2 years ago

1.0.20220323

2 years ago

1.0.20220407

2 years ago

1.0.20220329

2 years ago

1.0.20220218

2 years ago

1.0.20220302

2 years ago

1.0.20220309

2 years ago

1.0.20220312

2 years ago

1.0.20220106

2 years ago

1.0.20220116

2 years ago

1.0.20220112

2 years ago

1.0.20220126

2 years ago

1.0.20220207

2 years ago

1.0.20220128

2 years ago

1.0.20220214

2 years ago

1.0.20211215

2 years ago

1.0.20211105

2 years ago

1.0.20211206

2 years ago

1.0.20211202

2 years ago

1.0.20211119

2 years ago

1.0.20211025

3 years ago

1.0.20211020

3 years ago

1.0.20211004

3 years ago

1.0.20210916

3 years ago

1.0.20210908

3 years ago

1.0.20210827

3 years ago

1.0.20210826

3 years ago

1.0.20210806

3 years ago

1.0.20210731

3 years ago

1.0.20210726

3 years ago

1.0.20210717

3 years ago

1.0.20210705

3 years ago

1.0.20210624

3 years ago

1.0.20210604

3 years ago

1.0.20210602

3 years ago

1.0.20210514

3 years ago

1.0.20210512

3 years ago

1.0.20210428

3 years ago

1.0.20210417

3 years ago

1.0.20210410

3 years ago

1.0.20210403

3 years ago

1.0.20210319

3 years ago

1.0.20210311

3 years ago

1.0.20210224

3 years ago

1.0.20210218

3 years ago

1.0.20210205

3 years ago

1.0.20210122

3 years ago

1.0.20210112

3 years ago

1.0.20210106

3 years ago

1.0.20201215

3 years ago

1.0.20201207

3 years ago

1.0.20201127

3 years ago

1.0.20201117

3 years ago

1.0.20201110

3 years ago

1.0.20201102

3 years ago