@logi.one/document-client-gcp-secret
TypeScript icon, indicating that this package has built-in type declarations

0.2.8 • Public • Published

LogiONE Document Client with GCP Secret

This package add support for storing refresh token of LogiONE Document's API's client

@logi.one/document-client www.logi.one/document

Install

npm install @logi.one/document-client-gcp-secret

Quick start

Store the API key into Google Cloud Platform using Secret Manager

Then use createLogiONEDocumentClientWithGCPSecret to create a client instance.

It will read the API key from the secret. The client will automatically refresh the token when it expires and save it to the same secret.

const { createLogiONEDocumentClientWithGCPSecret } = require('@logi.one/document-client-gcp-secret')

async function run() {    
    const secretName = 'projects/my-project/logione-doc-refreshtoken'
    const client = await createLogiONEDocumentClientWithGCPSecret(secretName)     
    const documents = await client.search('documents', { limit: 10, columnFilters: [{ column: 'extension', value: 'docx', match: true }] })     
    console.table(documents)
}

run()

Need for support

If you need support, please feel free to contact us at info@logi.one. We will be happy to help you.

Package Sidebar

Install

npm i @logi.one/document-client-gcp-secret

Weekly Downloads

1

Version

0.2.8

License

ISC

Unpacked Size

34.6 kB

Total Files

17

Last publish

Collaborators

  • yenyen