0.0.20250609 • Published 1 year ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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.20250409

1 year ago

0.0.20250528

1 year ago

0.0.20250527

1 year ago

0.0.20250130

1 year ago

0.0.20250420

1 year ago

0.0.20250305

1 year ago

0.0.20250423

1 year ago

0.0.20250421

1 year ago

0.0.20250319

1 year ago

0.0.20241205

2 years ago

0.0.20250609

1 year ago

0.0.20250607

1 year ago

0.0.20250206

1 year ago

0.0.20241231

1 year ago

0.0.20241114

2 years ago

0.0.20241111

2 years ago

0.0.20250219

1 year ago

0.0.20250212

1 year ago

0.0.20250509

1 year ago

0.0.20250503

1 year ago

0.0.20250226

1 year ago

0.0.20250111

1 year ago

0.0.20250110

1 year ago

0.0.20250514

1 year ago

0.0.20250121

1 year ago

0.0.20241024

2 years ago

0.0.20241017

2 years ago

0.0.20241014

2 years ago

0.0.20240925

2 years ago

0.0.20241003

2 years ago

0.0.20240919

2 years ago

0.0.20240904

2 years ago

0.0.20240828

2 years ago

0.0.20240821

2 years ago

0.0.20240530

2 years ago

0.0.20240807

2 years ago

0.0.20240522

2 years ago

0.0.20240722

2 years ago

0.0.20240617

2 years ago

0.0.20240814

2 years ago

0.0.20240610

2 years ago

0.0.20240703

2 years ago

0.0.20240621

2 years ago

0.0.20240520

2 years ago

0.0.20240711

2 years ago

0.0.20240508

2 years ago

0.0.20240501

2 years ago

0.0.20240424

2 years ago

0.0.20240417

2 years ago

0.0.20240415

2 years ago

0.0.20240319

2 years ago

0.0.20240313

2 years ago

0.0.20240307

2 years ago

0.0.20240228

2 years ago

0.0.20240220

2 years ago

0.0.20240212

2 years ago

0.0.20240201

2 years ago

0.0.20240118

2 years ago

0.0.20240116

2 years ago

0.0.20240103

2 years ago

0.0.20230812

3 years ago

0.0.20231111

3 years ago

0.0.20230729

3 years ago

0.0.20230721

3 years ago

0.0.20230804

3 years ago

0.0.20230923

3 years ago

0.0.20231020

3 years ago

0.0.20231027

3 years ago

0.0.20231103

3 years ago

0.0.20230916

3 years ago

0.0.20231007

3 years ago

0.0.20230714

3 years ago

0.0.20231016

3 years ago

0.0.20230707

3 years ago

0.0.20230901

3 years ago

0.0.20231002

3 years ago

0.0.20230627

3 years ago

0.0.20230613

3 years ago

0.0.20230610

3 years ago

0.0.20230516

3 years ago

0.0.20230520

3 years ago

0.0.20230508

3 years ago

0.0.20230429

3 years ago

0.0.20230531

3 years ago

0.0.20230414

3 years ago

0.0.20230318

3 years ago

0.0.20230421

3 years ago

0.0.20230224

3 years ago

0.0.20230304

3 years ago

0.0.20230327

3 years ago

0.0.20230228

3 years ago

0.0.20230401

3 years ago

0.0.20230410

3 years ago

0.0.20230311

3 years ago

0.0.20230128

3 years ago

0.0.20230204

3 years ago

0.0.20230218

3 years ago

0.0.20230220

3 years ago

0.0.20230211

3 years ago

0.0.20230107

3 years ago

0.0.20221104

4 years ago

0.0.20221112

4 years ago

0.0.20230124

3 years ago

0.0.20230113

3 years ago

0.0.20230102

3 years ago

0.0.20221206

4 years ago

0.0.20221029

4 years ago

0.0.20221021

4 years ago

0.0.20221015

4 years ago

0.0.20220924

4 years ago