0.0.20241024 • Published 8 months ago

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

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

8 months ago

0.0.20241017

9 months ago

0.0.20241014

9 months ago

0.0.20240925

9 months ago

0.0.20241003

9 months ago

0.0.20240919

9 months ago

0.0.20240904

10 months ago

0.0.20240828

10 months ago

0.0.20240821

10 months ago

0.0.20240530

1 year ago

0.0.20240807

11 months ago

0.0.20240522

1 year ago

0.0.20240722

12 months ago

0.0.20240617

1 year ago

0.0.20240814

11 months ago

0.0.20240610

1 year ago

0.0.20240703

12 months ago

0.0.20240621

1 year ago

0.0.20240520

1 year ago

0.0.20240711

12 months ago

0.0.20240508

1 year ago

0.0.20240501

1 year ago

0.0.20240424

1 year ago

0.0.20240417

1 year ago

0.0.20240415

1 year ago

0.0.20240319

1 year ago

0.0.20240313

1 year ago

0.0.20240307

1 year ago

0.0.20240228

1 year ago

0.0.20240220

1 year ago

0.0.20240212

1 year ago

0.0.20240201

1 year ago

0.0.20240118

1 year ago

0.0.20240116

1 year ago

0.0.20240103

1 year ago

0.0.20230812

2 years ago

0.0.20231111

2 years ago

0.0.20230729

2 years ago

0.0.20230721

2 years ago

0.0.20230804

2 years ago

0.0.20230923

2 years ago

0.0.20231020

2 years ago

0.0.20231027

2 years ago

0.0.20231103

2 years ago

0.0.20230916

2 years ago

0.0.20231007

2 years ago

0.0.20230714

2 years ago

0.0.20231016

2 years ago

0.0.20230707

2 years ago

0.0.20230901

2 years ago

0.0.20231002

2 years ago

0.0.20230627

2 years ago

0.0.20230613

2 years ago

0.0.20230610

2 years ago

0.0.20230516

2 years ago

0.0.20230520

2 years ago

0.0.20230508

2 years ago

0.0.20230429

2 years ago

0.0.20230531

2 years ago

0.0.20230414

2 years ago

0.0.20230318

2 years ago

0.0.20230421

2 years ago

0.0.20230224

2 years ago

0.0.20230304

2 years ago

0.0.20230327

2 years ago

0.0.20230228

2 years ago

0.0.20230401

2 years ago

0.0.20230410

2 years ago

0.0.20230311

2 years ago

0.0.20230128

2 years ago

0.0.20230204

2 years ago

0.0.20230218

2 years ago

0.0.20230220

2 years ago

0.0.20230211

2 years ago

0.0.20230107

2 years ago

0.0.20221104

3 years ago

0.0.20221112

3 years ago

0.0.20230124

2 years ago

0.0.20230113

2 years ago

0.0.20230102

3 years ago

0.0.20221206

3 years ago

0.0.20221029

3 years ago

0.0.20221021

3 years ago

0.0.20221015

3 years ago

0.0.20220924

3 years ago