0.0.20240503 • Published 4 days ago

@maxim_mazurok/gapi.client.smartdevicemanagement-v1 v0.0.20240503

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days 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(
  'https://smartdevicemanagement.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.smartdevicemanagement
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
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',
  ],
  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:

0.0.20240503

4 days ago

0.0.20240324

1 month ago

0.0.20240317

2 months ago

0.0.20240303

2 months ago

0.0.20240218

2 months ago

0.0.20240128

3 months ago

0.0.20240122

4 months ago

0.0.20231231

4 months ago

0.0.20231202

5 months ago

0.0.20231029

6 months ago

0.0.20230716

10 months ago

0.0.20230807

9 months ago

0.0.20230708

10 months ago

0.0.20230907

8 months ago

0.0.20231119

5 months ago

0.0.20230726

9 months ago

0.0.20230823

9 months ago

0.0.20230703

10 months ago

0.0.20230514

12 months ago

0.0.20230620

11 months ago

0.0.20230425

1 year ago

0.0.20230605

11 months ago

0.0.20230530

12 months ago

0.0.20230315

1 year ago

0.0.20230417

1 year ago

0.0.20230219

1 year ago

0.0.20230301

1 year ago

0.0.20230327

1 year ago

0.0.20230424

1 year ago

0.0.20230402

1 year ago

0.0.20230306

1 year ago

0.0.20230207

1 year ago

0.0.20230122

1 year ago

0.0.20221210

1 year ago

0.0.20221107

1 year ago

0.0.20230112

1 year ago

0.0.20221128

1 year ago

0.0.20221029

2 years ago

0.0.20221017

2 years ago

0.0.20221023

2 years ago

0.0.20221009

2 years ago

0.0.20220926

2 years ago

0.0.20220916

2 years ago

0.0.20220906

2 years ago

0.0.20220821

2 years ago

0.0.20220812

2 years ago

0.0.20220914

2 years ago

0.0.20220806

2 years ago

0.0.20220730

2 years ago