-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(clerk-js,clerk-react,nextjs,types): Drop experimental tag from G…
…oogleOneTap (#3392) * feat(clerk-js,clerk-react,nextjs,types): Drop experimental tag from GoogleOneTap * feat(clerk-js,clerk-react,nextjs,types): Add changeset * test(chrome-extension): Update snapshots
- Loading branch information
1 parent
6888594
commit d6a9b3f
Showing
20 changed files
with
167 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
'@clerk/clerk-js': minor | ||
'@clerk/nextjs': minor | ||
'@clerk/clerk-react': minor | ||
'@clerk/types': minor | ||
--- | ||
|
||
Add support for GoogleOneTap. New APIs listed: | ||
### React component | ||
- `<GoogleOneTap/>` | ||
|
||
Customize the UX of the prompt | ||
|
||
```tsx | ||
<GoogleOneTap | ||
cancelOnTapOutside={false} | ||
itpSupport={false} | ||
fedCmSupport={false} | ||
/> | ||
``` | ||
|
||
### Use the component from with Vanilla JS | ||
- `Clerk.openGoogleOneTap(props: GoogleOneTapProps)` | ||
- `Clerk.closeGoogleOneTap()` | ||
### Low level APIs for custom flows | ||
- `await Clerk.authenticateWithGoogleOneTap({ token: 'xxxx'})` | ||
- `await Clerk.handleGoogleOneTapCallback()` | ||
|
||
We recommend using this two methods together in order and let Clerk to perform the correct redirections. | ||
```tsx | ||
google.accounts.id.initialize({ | ||
callback: async response => { | ||
const signInOrUp = await Clerk.authenticateWithGoogleOneTap({ token: response.credential}) | ||
await Clerk.handleGoogleOneTapCallback(signInOrUp, { | ||
signInForceRedirectUrl: window.location.href, | ||
}) | ||
}, | ||
}); | ||
``` | ||
|
||
In case you want to handle the redirection and session management yourself you can do so like this | ||
```tsx | ||
google.accounts.id.initialize({ | ||
callback: async response => { | ||
const signInOrUp = await Clerk.authenticateWithGoogleOneTap({ token: response.credential}) | ||
if(signInOrUp.status === 'complete') { | ||
await Clerk.setActive({ | ||
session: signInOrUp.createdSessionId | ||
}) | ||
} | ||
}, | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.