ScottEAdams

payload plugin google one tap

by ScottEAdams
Authentication & SSO
v1
^1.1.15
MIT

Overview

Summary generated from the README

Adds Google One Tap and a Google sign-in button to the Payload login page. It is registered as a plugin in the Payload config and needs a Google client ID and secret as environment variables. It targets Payload 1.x, so it needs a webpack fallback config for the admin and express JSON parsing on the server.

Features

  • Google One Tap prompt on the login page
  • Customizable button type, theme, size, text, shape and width
  • Options for auto select and popup UX mode
  • Configured through Google client ID and secret environment variables

Use cases

  • Let admin users sign in to Payload with their Google account
  • Offer one-click Google login on a Payload 1.x project

From the author

Adds Google One Tap login to Payload CMS

Installation

npm i payload-plugin-google-one-tap

13

Stars

1

Forks

1

Open Issues

4 years ago

Last Updated

15

Weekly Downloads

v1.0.7

npm Version

47.6 KB

Unpacked Size

5

Dependencies

GitHub stars

130 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 202613
Dec 5, 202613
Dec 4, 202613
Dec 3, 202613
Dec 2, 202613
Dec 1, 202613
Nov 30, 202613
Nov 29, 202613
Nov 28, 202613
Nov 27, 202613
Nov 26, 202613
Nov 25, 202613
Nov 24, 202613
Nov 23, 202613
Nov 22, 202613
Nov 21, 202613
Nov 20, 202613
Nov 19, 202613
Nov 18, 202613
Nov 17, 202613
Nov 16, 202613
Nov 15, 202613
Nov 14, 202613
Nov 13, 202613
Nov 12, 202613
Nov 11, 202613
Nov 10, 202613
Nov 9, 202613
Nov 8, 202613
Nov 7, 202613
Nov 6, 202613
Nov 5, 202613
Nov 4, 202613
Nov 3, 202613
Nov 2, 202613
Nov 1, 202613
Oct 31, 202613
Oct 30, 202613
Oct 29, 202613
Oct 28, 202613
Oct 27, 202613
Oct 26, 202613
Oct 25, 202613
Oct 24, 202613
Oct 23, 202613
Oct 22, 202613
Oct 21, 202613
Oct 20, 202613
Oct 19, 202613
Oct 18, 202613
Oct 17, 202613
Oct 16, 202613
Oct 15, 202613
Oct 14, 202613
Oct 13, 202613
Oct 12, 202613
Oct 11, 202613
Oct 10, 202613
Oct 9, 202613
Oct 8, 202613
Oct 7, 202613
Oct 6, 202613
Oct 5, 202613
Oct 4, 202613
Oct 3, 202613
Oct 2, 202613
Oct 1, 202613
Sep 30, 202613
Sep 29, 202613
Sep 28, 202613
Sep 27, 202613
Sep 26, 202613
Sep 25, 202613
Sep 24, 202613
Sep 23, 202613
Sep 22, 202613
Sep 21, 202613
Sep 20, 202613
Sep 19, 202613
Sep 18, 202613
Sep 17, 202613
Sep 16, 202613
Sep 15, 202613
Sep 14, 202613
Sep 13, 202613
Sep 12, 202613
Sep 11, 202613
Sep 10, 202613
Sep 9, 202613
Sep 8, 202613
Sep 7, 202613
npm weekly downloads

16+6 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 202616
Dec 5, 202616
Dec 4, 20262
Dec 3, 20266
Dec 2, 20266
Dec 1, 20268
Nov 30, 20269
Nov 29, 202612
Nov 28, 202620
Nov 27, 202620
Nov 26, 202618
Nov 25, 202618
Nov 24, 202616
Nov 23, 202617
Nov 22, 202617
Nov 21, 202612
Nov 20, 202611
Nov 19, 202610
Nov 18, 202611
Nov 17, 202613
Nov 16, 202615
Nov 15, 202616
Nov 14, 202613
Nov 13, 202615
Nov 12, 202621
Nov 11, 202620
Nov 10, 202620
Nov 9, 202616
Nov 8, 202612
Nov 7, 202612
Nov 6, 202610
Nov 5, 20264
Nov 4, 20264
Nov 3, 20263
Nov 2, 202620
Nov 1, 202621
Oct 31, 202623
Oct 30, 202623
Oct 29, 202622
Oct 28, 202622
Oct 27, 202622
Oct 26, 20268
Oct 25, 20266
Oct 24, 20266
Oct 23, 20266
Oct 22, 20266
Oct 21, 20266
Oct 20, 20265
Oct 19, 20262
Oct 18, 20262
Oct 17, 20261
Oct 16, 20261
Oct 15, 20263
Oct 14, 202610
Oct 13, 202610
Oct 12, 202610
Oct 11, 202611
Oct 10, 202610
Oct 9, 202611
Oct 8, 202610
Oct 7, 20265
Oct 6, 20265
Oct 5, 20265
Oct 4, 20267
Oct 3, 20268
Oct 2, 20267
Oct 1, 20266
Sep 30, 20264
Sep 29, 202611
Sep 28, 202611
Sep 27, 202611
Sep 26, 202619
Sep 25, 202619
Sep 24, 202619
Sep 23, 202619
Sep 22, 202619
Sep 21, 202619
Sep 20, 202617
Sep 19, 20268
Sep 18, 20268
Sep 17, 202610
Sep 16, 202612
Sep 15, 20266
Sep 14, 20268
Sep 13, 20267
Sep 12, 20267
Sep 11, 20267
Sep 10, 20266
Sep 9, 20265
Sep 8, 20268
Sep 7, 202610

Each point is npm's rolling 7-day download count.

Health Score

0/100Archived

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/555615120-root.svg)](https://payloaddirectory.dev/plugins/555615120-root)
HTML
<a href="https://payloaddirectory.dev/plugins/555615120-root"><img src="https://payloaddirectory.dev/badge/555615120-root.svg" alt="Payload Directory"></a>
Updated Nov 22, 2022Created Oct 21, 2022Published Nov 22, 2022

README

payload-plugin-google-one-tap

Adds google-one-tap functionality to the login page.

Installation

yarn add payload-plugin-google-one-tap

You will need to add your google credentials as environment variables:

PAYLOAD_PUBLIC_GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-secret

Then you can add the plugin to your payload.config:

import { googleOneTap } from 'payload-plugin-google-one-tap'

export default buildConfig({
    ...
    plugins: [googleOneTap()],
    ...
})

This package uses the following libraries:

https://github.com/MomenSherif/react-oauth

https://github.com/Genially/passport-google-one-tap

You will need to add the following webpack config:

    admin: {
		webpack: (config) => ({
			...config,
			resolve: {
				...config.resolve,
				fallback: {
					...config.resolve.fallback,
					util: require.resolve('util'),
					stream: require.resolve('stream-browserify'),
					fs: false,
					url: false,
					querystring: false,
					child_process: false,
					assert: false,
					tls: false,
					net: false,
					os: false
				}
			}
		})
	}

And finally you will need to add the following to your server.ts file:

const app = express()

app.use(express.json())

You can customise the login button if you like by passing in some props in your payload.config.ts. Heres the defaults:

plugins: [
	googleOneTap({
		type: 'standard',
		theme: 'outline',
		size: 'large',
		text: 'signin_with',
		shape: 'rectangular',
		logo_alignment: 'left',
		width: undefined, // auto,
		locale: undefined,
		useOneTap: true,
		auto_select: false,
		ux_mode: 'popup'
	})
]

Similar plugins