Skip to main content
Module

x/deno_kv_oauth/mod.ts>createGoogleOAuth2Client

High-level OAuth 2.0 powered by Deno KV.
Go to Latest
function createGoogleOAuth2Client
import { createGoogleOAuth2Client } from "https://deno.land/x/deno_kv_oauth@v0.2.7/mod.ts";

Creates an OAuth 2.0 client with Google as the provider.

Requires --allow-env[=GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET] permissions and environment variables:

  1. GOOGLE_CLIENT_ID
  2. GOOGLE_CLIENT_SECRET

Examples

Example 1

import { createGoogleOAuth2Client } from "https://deno.land/x/deno_kv_oauth@$VERSION/mod.ts";

const oauth2Client = createGoogleOAuth2Client({
 redirectUri: "http://localhost:8000/callback",
 defaults: {
   scope: "https://www.googleapis.com/auth/userinfo.profile"
 }
});

Parameters

additionalOAuth2ClientConfig: Partial<OAuth2ClientConfig> & WithRedirectUri & WithScope

Requires redirectUri and defaults.scope properties.