<OAuthButton />

Renders a customized OAuth button for various providers to initiate sign-in or sign-up processes.

OAuthButton

Note that if the specific OAuth provider is disabled in the dashboard, this component will still render. However, attempting to use it will result in an error being thrown.

For more information, please refer to the custom pages guide.

Props

PropTypeDefaultDescription
provider
stringThe name of the OAuth provider (e.g., 'google', 'github', 'facebook').
type
'sign-in' | 'sign-up'Determines whether the button text is for signing in or signing up. (both are the same in terms of functionality)

Example

import { OAuthButton } from '@stackframe/stack';

export default function Page() {
  return (
    <div>
      <h1>Sign In</h1>
      <OAuthButton provider="google" type="sign-in" />
      <OAuthButton provider="github" type="sign-up" />
    </div>
  );
}

The OAuthButton component automatically styles itself based on the provided OAuth provider and handles the sign-in or sign-up process when clicked.

Table of Contents

Navigate this page

On this page

Stack Auth AI

Documentation assistant

Experimental: AI responses may not always be accurate—please verify important details.

For the most accurate information, please join our Discord or email us.

How can I help?

Ask me about Stack Auth while you browse the docs.