0.0.20240507 • Published 8 days ago

@maxim_mazurok/gapi.client.indexing-v3 v0.0.20240507

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

TypeScript typings for Web Search Indexing API v3

Notifies Google Web Search when your web pages change. For detailed description please check documentation.

Installing

Install typings for Web Search Indexing API:

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

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 = [
    // Submit data to Google for indexing
    'https://www.googleapis.com/auth/indexing',
  ],
  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 Web Search Indexing API resources:

/*
Gets metadata about a Web Document. This method can _only_ be used to query URLs that were previously seen in successful Indexing API notifications. Includes the latest `UrlNotification` received via this API.
*/
await gapi.client.indexing.urlNotifications.getMetadata({});

/*
Notifies that a URL has been updated or deleted.
*/
await gapi.client.indexing.urlNotifications.publish({});
0.0.20240507

8 days ago

0.0.20240423

22 days ago

0.0.20240409

1 month ago

0.0.20240404

1 month ago

0.0.20240326

2 months ago

0.0.20240319

2 months ago

0.0.20240312

2 months ago

0.0.20240305

2 months ago

0.0.20240227

3 months ago

0.0.20240220

3 months ago

0.0.20240213

3 months ago

0.0.20240206

3 months ago

0.0.20240130

4 months ago

0.0.20240123

4 months ago

0.0.20240116

4 months ago

0.0.20240109

4 months ago

0.0.20240102

4 months ago

0.0.20231225

5 months ago

0.0.20231205

5 months ago

0.0.20231128

6 months ago

0.0.20230718

10 months ago

0.0.20230711

10 months ago

0.0.20231107

6 months ago

0.0.20230815

9 months ago

0.0.20230912

8 months ago

0.0.20231010

7 months ago

0.0.20231031

7 months ago

0.0.20231114

6 months ago

0.0.20230829

9 months ago

0.0.20230808

9 months ago

0.0.20230927

8 months ago

0.0.20230905

8 months ago

0.0.20230822

9 months ago

0.0.20230704

11 months ago

0.0.20230627

11 months ago

0.0.20230801

10 months ago

0.0.20230725

10 months ago

0.0.20231121

6 months ago

0.0.20231003

8 months ago

0.0.20231024

7 months ago

0.0.20230620

11 months ago

0.0.20230509

1 year ago

0.0.20230613

11 months ago

0.0.20230523

12 months ago

0.0.20230606

11 months ago

0.0.20230530

12 months ago

0.0.20230418

1 year ago

0.0.20230208

1 year ago

0.0.20230223

1 year ago

0.0.20230117

1 year ago

0.0.20221201

1 year ago

0.0.20221101

2 years ago

0.0.20221220

1 year ago

0.0.20220927

2 years ago

0.0.20220921

2 years ago

0.0.20221025

2 years ago

0.0.20221013

2 years ago

0.0.20221011

2 years ago

0.0.20220914

2 years ago

0.0.20220815

2 years ago

0.0.20220809

2 years ago

0.0.20220726

2 years ago