@maxim_mazurok/gapi.client.identitytoolkit-v2 v0.0.20240508
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({});
6 days ago
14 days ago
25 days ago
27 days ago
1 month ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
9 months ago
6 months ago
10 months ago
10 months ago
10 months ago
8 months ago
7 months ago
7 months ago
7 months ago
8 months ago
7 months ago
10 months ago
7 months ago
11 months ago
9 months ago
8 months ago
11 months ago
11 months ago
11 months ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago