instant-indexing
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Instant Indexing

Instant indexing using google API

env variable needed

GAPI=xxxGOOGLE API KEY V3xxx
GCLIENT=x-xxx.apps.googleusercontent.com
GSECRET=xxx-xxxx-xxx
GCALLBACK=http://localhost:4000/auth
GSERVICEKEY=xxxGOOGLE SERVICE KEYxxx
GSERVICEMAIL=main-xxx@xxx-xxx.iam.gserviceaccount.com
GSERVICEID=xxxGOOGLE SERVICE IDxxx
GCLIENTPEM=base64 encoded JSON google client
GSERVICEPEM=base64 encoded JSON google service IAM admin

Basic Usage

import { google } from 'googleapis';
import { jwtAuthenticate } from 'instant-indexing';

jwtAuthenticate(['profile']).then((client) => {
  // retrieve user profile
  const people = google.people({ auth: client, version: 'v1' });
  people.people
    .get({
      resourceName: 'people/me',
      personFields: 'emailAddresses'
    })
    .then((res) => {
      console.log(res.data);
    });
});

To index article

import { notify2, jwtAuthenticate } from 'instant-indexing';

jwtAuthenticate().then((client) => {
  notify2('https://www.webmanajemen.com/chimeraland/monsters/cicada.html', 'URL_UPDATED', client.credentials);
});

Package Sidebar

Install

npm i instant-indexing

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

51.4 kB

Total Files

21

Last publish

Collaborators

  • dimaslanjaka