Adds Google One Tap login to Payload CMS
Installation
npm i payload-plugin-google-one-tap13
Stars
1
Forks
1
Open Issues
3 years ago
Last Updated
1
Weekly Downloads
v1.0.7
npm Version
47.6 KB
Unpacked Size
5
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/555615120-root)<a href="https://payloaddirectory.dev/plugins/555615120-root"><img src="https://payloaddirectory.dev/badge/555615120-root.svg" alt="Payload Directory"></a>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:
```dotenv
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:
```js
import { googleOneTap } from 'payload-plugin-google-one-tap'# 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:
```dotenv
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:
```js
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:
```js
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:
```js
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:
```js
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'
})
]
```
Topics
payload better auth
Better Auth database adapter and plugins that replace Payload's local auth strategy
700/wk74v3
payload simple social login
Google and Microsoft Entra ID social login for the Payload admin panel and auth collections
650/wk3v3
payload auth
Replaces Payload's built-in auth with Better Auth, sharing one session between the admin panel and your app
590/wk344v3
payload oauth2
Generic OAuth2 sign-in for Payload auth collections with any OAuth2 provider
570/wk198v3
payload authjs
Use Auth.js 5 providers to sign in and authenticate users in Payload CMS 3
560/wk207v3
payload keycloak
Keycloak SSO login for the Payload admin using OIDC with PKCE, silent refresh and permission-based access helpers
500/wk0v3