SignInGoogleButton
One-click Google OAuth sign-in trigger. Defaults to a full-page redirect to `$oauthBaseUrl/oauth/google`, mirroring the production MOS flow.
One-click Google OAuth sign-in trigger. Defaults to a full-page redirect to ${oauthBaseUrl}/oauth/google, mirroring the production MOS flow.
import { SignInGoogleButton } from "@tetherto/mdk-react-devkit";| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
icon | Required | React.ReactNode | — | Icon node rendered alongside `children`. |
loading | Required | boolean | undefined | — | Show a spinner instead of the content and disable the button. |
variant | Required | ButtonVariant | undefined | — | Visual variant (e.g. `primary`, `secondary`, `ghost`). |
size | Required | ComponentSize | undefined | — | Size token (`sm`, `md`, `lg`). |
fullWidth | Required | boolean | undefined | — | Make the button stretch to fill its container. |
contentClassName | Required | string | undefined | — | Class names applied to the inner content wrapper. |
iconPosition | Required | ButtonIconPosition | undefined | — | Icon placement relative to children. |
oauthBaseUrl | Required | string | — | Base URL of the OAuth backend (no trailing slash). Click navigates to `${oauthBaseUrl}/oauth/google`. |
label | Optional | string | undefined | — | Override the visible button label. |
onClick | Optional | (() => void) | undefined | — | Override the click behaviour entirely. When set, `oauthBaseUrl` is ignored. |
Usage
Single-button Google OAuth sign-in trigger. Defaults to a full-page redirect
to ${oauthBaseUrl}/oauth/google. The backend issues a JWT and redirects
back with ?authToken=…, which useAuthToken then persists into the
session store.
Notes
- Uses
window.location.href(full-page navigation) rather than client-side routing so the OAuth callback URL is treated as an external load. - The backend must register the FE callback URL under the Google OAuth
client. For local dev with
miningos-gateway, that'shttp://localhost:3000/oauth/google/callbackpluscallbackUriUI=http://localhost:3030.
Example
/** * Runnable example for SignInGoogleButton. * * Triggers a full-page redirect to the OAuth backend. In a real app you'd * read `oauthBaseUrl` from `import.meta.env.VITE_OAUTH_BASE_URL`. */import { SignInGoogleButton } from '@tetherto/mdk-react-devkit'export const SignInGoogleButtonExample = () => ( <SignInGoogleButton oauthBaseUrl="http://localhost:3000" />)RequireAuth
Route guard that reads the session token from the headless `authStore` (via `useAuth`) and renders the children only when a token is present. Otherwise it re…
ActiveIncidentsCard
Summary card displaying a list of active incidents/alerts with severity indicators, loading skeleton, and empty state. Rows are virtualized via `@tanstack/re…