Skip to content

Commit 9ec2e53

Browse files
author
patched.codes[bot]
committed
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/sdk/oauth-button.mdx
1 parent ec28f90 commit 9ec2e53

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: OAuthButton
3+
---
4+
5+
# OAuthButton
6+
7+
A React component for rendering an OAuth button with styling based on the provider.
8+
9+
## Parameters
10+
11+
- `provider`: `string` - The OAuth provider (e.g., 'google', 'github', 'facebook', 'microsoft', 'spotify').
12+
- `type`: `'sign-in' | 'sign-up'` - Determines whether the button is for sign-in or sign-up.
13+
14+
## Example
15+
16+
```tsx
17+
import { OAuthButton } from '@stackframe/stack';
18+
19+
// Sign-in button for Google
20+
<OAuthButton provider='google' type='sign-in' />
21+
22+
// Sign-up button for GitHub
23+
<OAuthButton provider='github' type='sign-up' />
24+
```
25+
26+
The component automatically applies appropriate styling based on the provider and handles the OAuth sign-in process when clicked. It uses the `useStackApp` hook internally to manage the authentication flow.

0 commit comments

Comments
 (0)