Reference · React
<SignInWithTechne />
React componenttechne-sdk/auth/react
The sign-in button. A click sends the person to sign in at their own PDS, as your app's OAuth client.
It needs a <TechneProvider clientId> above it and throws without one. While a sign-in runs the button is disabled and aria-busy, and a second click starts nothing. A sign-in that fails goes to the provider's onError and frees the button again.
Props
| Name | Type | What it is |
|---|---|---|
handle | string | Who signs in. The provider's handle by default. With none, sign-in starts at the techne.town PDS, which asks. |
signUp | boolean | Create an account at the techne.town PDS instead. |
children | ReactNode | The label. By default it reads Sign in with Techne. |
onClick | (event) => void | Runs before the sign-in. Call event.preventDefault() to stop it. |
Every other prop goes to the <button>, which is type="button" unless you pass another.
Around it also in techne-sdk/auth/react
| Name | Type | What it is |
|---|---|---|
useSession() | OAuthSession | null | The session once someone is signed in. useSession |
useAuthStatus() | 'restoring' | 'signed-in' | 'signed-out' | Where sign-in stands. |
useSignOut() | () => Promise<void> | Signs the person out. |
Sign in, or make an account
The person leaves for their PDS and comes back to your redirect URI. The provider then restores the session.
The same sign-in as a call
The button calls signIn with the provider's clientId, platform and scope.
Calls signIn → with the provider's client options