BigBlocks
With OAuth Providers
or restore with
Outline / Small
Ghost / Large
Installation
bunx shadcn@latest add https://registry.bigblocks.dev/r/bitcoin-signin.jsonUsage
The block requires a signIn function that matches the shape of authClient.signIn.sigma() from a Better Auth client configured with the sigma plugin.
import { authClient } from "@/lib/auth-client"
import { BitcoinSignin } from "@/components/blocks/bitcoin-signin"
export default function LoginPage() {
return (
<BitcoinSignin
clientId="my-app"
signIn={(opts) => authClient.signIn.sigma(opts)}
showProviders
onError={(err) => console.error("Sign-in failed:", err)}
/>
)
}Variants
Default
A single "Sign in with Bitcoin" button using the sigma brand icon.
<BitcoinSignin clientId="my-app" signIn={signIn} />With OAuth Providers
Shows OAuth provider buttons below the primary button for account restore/linking.
<BitcoinSignin
clientId="my-app"
signIn={signIn}
showProviders
providers={["github", "google"]}
/>Size and Style Variants
<BitcoinSignin clientId="my-app" signIn={signIn} variant="outline" size="sm" />
<BitcoinSignin clientId="my-app" signIn={signIn} variant="ghost" size="lg" />Props
BitcoinSignin
| Prop | Type | Default | Description |
|---|---|---|---|
clientId | string | — | OAuth client ID registered with Sigma Identity (required) |
signIn | SigmaSignInFn | — | The signIn.sigma function from a Better Auth client (required) |
callbackUrl | string | window.location.origin + "/auth/sigma/callback" | Callback URL after OAuth redirect |
showProviders | boolean | false | Show OAuth provider buttons for account restore |
providers | OAuthProvider[] | ["github", "google"] | Which OAuth providers to show |
variant | "default" | "outline" | "ghost" | "default" | Visual style variant |
size | "sm" | "md" | "lg" | "md" | Size variant |
className | string | — | Additional CSS classes |
onError | (error: Error) => void | — | Called when a sign-in error occurs |
Hook
useBitcoinSignin can be used independently for a custom sign-in UI.
import { useBitcoinSignin } from "@/components/blocks/bitcoin-signin"
function CustomLogin() {
const { isLoading, error, loginWithSigma, loginWithProvider } =
useBitcoinSignin({
clientId: "my-app",
signIn: (opts) => authClient.signIn.sigma(opts),
})
return (
<button onClick={loginWithSigma} disabled={isLoading}>
{isLoading ? "Signing in..." : "Sign in"}
</button>
)
}