0.0.20240508 • Published 6 days ago

@maxim_mazurok/gapi.client.identitytoolkit-v2 v0.0.20240508

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

TypeScript typings for Identity Toolkit API v2

The Google Identity Toolkit API lets you use open standards to verify a user's identity. For detailed description please check documentation.

Installing

Install typings for Identity Toolkit API:

npm install @types/gapi.client.identitytoolkit-v2 --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://identitytoolkit.googleapis.com/$discovery/rest?version=v2',
  () => {
    // now we can use:
    // gapi.client.identitytoolkit
  }
);
// 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('identitytoolkit', 'v2', () => {
  // now we can use:
  // gapi.client.identitytoolkit
});

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, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
    'https://www.googleapis.com/auth/cloud-platform',

    // View and administer all your Firebase data and settings
    'https://www.googleapis.com/auth/firebase',
  ],
  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 Identity Toolkit API resources:

/*
Revokes a user's token from an Identity Provider (IdP). This is done by manually providing an IdP credential, and the token types for revocation. An [API key](https://cloud.google.com/docs/authentication/api-keys) is required in the request in order to identify the Google Cloud project.
*/
await gapi.client.identitytoolkit.accounts.revokeToken({});

/*
List all default supported Idps.
*/
await gapi.client.identitytoolkit.defaultSupportedIdps.list({});

/*
Retrieve an Identity Toolkit project configuration.
*/
await gapi.client.identitytoolkit.projects.getConfig({name: 'name'});

/*
Update an Identity Toolkit project configuration.
*/
await gapi.client.identitytoolkit.projects.updateConfig({name: 'name'});

/*
Gets password policy config set on the project or tenant.
*/
await gapi.client.identitytoolkit.getPasswordPolicy({});

/*
Gets parameters needed for reCAPTCHA analysis.
*/
await gapi.client.identitytoolkit.getRecaptchaConfig({});
0.0.20240508

6 days ago

0.0.20240501

14 days ago

0.0.20240424

25 days ago

0.0.20240417

27 days ago

0.0.20240415

1 month ago

0.0.20240319

2 months ago

0.0.20240313

2 months ago

0.0.20240307

2 months ago

0.0.20240228

3 months ago

0.0.20240220

3 months ago

0.0.20240212

3 months ago

0.0.20240201

4 months ago

0.0.20240118

4 months ago

0.0.20240116

4 months ago

0.0.20240103

4 months ago

0.0.20230812

9 months ago

0.0.20231111

6 months ago

0.0.20230729

10 months ago

0.0.20230721

10 months ago

0.0.20230804

10 months ago

0.0.20230923

8 months ago

0.0.20231020

7 months ago

0.0.20231027

7 months ago

0.0.20231103

7 months ago

0.0.20230916

8 months ago

0.0.20231007

7 months ago

0.0.20230714

10 months ago

0.0.20231016

7 months ago

0.0.20230707

11 months ago

0.0.20230901

9 months ago

0.0.20231002

8 months ago

0.0.20230627

11 months ago

0.0.20230613

11 months ago

0.0.20230610

11 months ago

0.0.20230516

1 year ago

0.0.20230520

12 months ago

0.0.20230508

1 year ago

0.0.20230429

1 year ago

0.0.20230531

12 months ago

0.0.20230414

1 year ago

0.0.20230318

1 year ago

0.0.20230421

1 year ago

0.0.20230224

1 year ago

0.0.20230304

1 year ago

0.0.20230327

1 year ago

0.0.20230228

1 year ago

0.0.20230401

1 year ago

0.0.20230410

1 year ago

0.0.20230311

1 year ago

0.0.20230128

1 year ago

0.0.20230204

1 year ago

0.0.20230218

1 year ago

0.0.20230220

1 year ago

0.0.20230211

1 year ago

0.0.20230107

1 year ago

0.0.20221104

2 years ago

0.0.20221112

2 years ago

0.0.20230124

1 year ago

0.0.20230113

1 year ago

0.0.20230102

1 year ago

0.0.20221206

1 year ago

0.0.20221029

2 years ago

0.0.20221021

2 years ago

0.0.20221015

2 years ago

0.0.20220924

2 years ago