0.0.20250603 • Published 10 months ago

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

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.20250529

10 months ago

0.0.20250603

10 months ago

0.0.20250328

12 months ago

0.0.20250527

10 months ago

0.0.20250128

1 year ago

0.0.20250204

1 year ago

0.0.20250211

1 year ago

0.0.20241029

1 year ago

0.0.20241120

1 year ago

0.0.20250505

11 months ago

0.0.20250423

11 months ago

0.0.20250224

1 year ago

0.0.20250512

11 months ago

0.0.20250314

1 year ago

0.0.20250116

1 year ago

0.0.20250311

1 year ago

0.0.20250123

1 year ago

0.0.20250120

1 year ago

0.0.20241205

1 year ago

0.0.20241209

1 year ago

0.0.20240926

2 years ago

0.0.20240916

2 years ago

0.0.20240826

2 years ago

0.0.20240806

2 years ago

0.0.20240723

2 years ago

0.0.20240527

2 years ago

0.0.20240616

2 years ago

0.0.20240731

2 years ago

0.0.20240708

2 years ago

0.0.20240503

2 years ago

0.0.20240324

2 years ago

0.0.20240317

2 years ago

0.0.20240303

2 years ago

0.0.20240218

2 years 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

3 years ago

0.0.20230807

3 years ago

0.0.20230708

3 years ago

0.0.20230907

3 years ago

0.0.20231119

2 years ago

0.0.20230726

3 years ago

0.0.20230823

3 years ago

0.0.20230703

3 years ago

0.0.20230514

3 years ago

0.0.20230620

3 years ago

0.0.20230425

3 years ago

0.0.20230605

3 years ago

0.0.20230530

3 years ago

0.0.20230315

3 years ago

0.0.20230417

3 years ago

0.0.20230219

3 years ago

0.0.20230301

3 years ago

0.0.20230327

3 years ago

0.0.20230424

3 years ago

0.0.20230402

3 years ago

0.0.20230306

3 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

4 years ago

0.0.20220906

4 years ago

0.0.20220821

4 years ago

0.0.20220812

4 years ago

0.0.20220914

4 years ago

0.0.20220806

4 years ago

0.0.20220730

4 years ago