0.0.20240926 • Published 10 months ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months 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.20240926

10 months ago

0.0.20240916

11 months ago

0.0.20240826

11 months ago

0.0.20240806

1 year ago

0.0.20240723

1 year ago

0.0.20240527

1 year ago

0.0.20240616

1 year ago

0.0.20240731

1 year ago

0.0.20240708

1 year ago

0.0.20240503

1 year ago

0.0.20240324

1 year ago

0.0.20240317

1 year ago

0.0.20240303

1 year ago

0.0.20240218

1 year ago

0.0.20240128

2 years ago

0.0.20240122

2 years ago

0.0.20231231

2 years ago

0.0.20231202

2 years ago

0.0.20231029

2 years ago

0.0.20230716

2 years ago

0.0.20230807

2 years ago

0.0.20230708

2 years ago

0.0.20230907

2 years ago

0.0.20231119

2 years ago

0.0.20230726

2 years ago

0.0.20230823

2 years ago

0.0.20230703

2 years ago

0.0.20230514

2 years ago

0.0.20230620

2 years ago

0.0.20230425

2 years ago

0.0.20230605

2 years ago

0.0.20230530

2 years ago

0.0.20230315

2 years ago

0.0.20230417

2 years ago

0.0.20230219

2 years ago

0.0.20230301

2 years ago

0.0.20230327

2 years ago

0.0.20230424

2 years ago

0.0.20230402

2 years ago

0.0.20230306

2 years ago

0.0.20230207

3 years ago

0.0.20230122

3 years ago

0.0.20221210

3 years ago

0.0.20221107

3 years ago

0.0.20230112

3 years ago

0.0.20221128

3 years ago

0.0.20221029

3 years ago

0.0.20221017

3 years ago

0.0.20221023

3 years ago

0.0.20221009

3 years ago

0.0.20220926

3 years ago

0.0.20220916

3 years ago

0.0.20220906

3 years ago

0.0.20220821

3 years ago

0.0.20220812

3 years ago

0.0.20220914

3 years ago

0.0.20220806

3 years ago

0.0.20220730

3 years ago