How to use the googleapis-common.OAuth2Client function in googleapis-common

To help you get started, we’ve selected a few googleapis-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sourcegraph / sourcegraph / dev / release / src / google-calendar.ts View on Github external
export async function getClient(): Promise {
    const credentials = JSON.parse(
        await readLine(
            'Paste Google Calendar credentials (1Password "Release automation Google Calendar API App credentials"): ',
            '.secrets/google-calendar-credentials.json'
        )
    )
    const { client_secret, client_id, redirect_uris } = credentials.installed
    const oauth2Client = new OAuth2Client(client_id, client_secret, redirect_uris[0])
    oauth2Client.setCredentials(await getAccessToken(oauth2Client))
    return oauth2Client
}

googleapis-common

A common tooling library used by the googleapis npm module. You probably don't want to use this directly.

Apache-2.0
Latest version published 8 days ago

Package Health Score

91 / 100
Full package analysis

Similar packages