SUPER EARLY WIP — USE AT YOUR OWN RISK
shoo
GitHubCOMING SOON

Getting Started (React)

Add Google sign-in to a React app in 3 lines

Install

bun add @shoojs/react

Add sign-in

App.tsx
import { useShooAuth } from "@shoojs/react";

export default function App() {
  const { identity, loading, signIn, clearIdentity } = useShooAuth();

  if (loading) return <p>Loading…</p>;
  if (!identity.userId) return <button onClick={() => signIn()}>Sign in</button>;

  return (
    <div>
      <p>Welcome, {identity.userId}</p>
      <button onClick={clearIdentity}>Sign out</button>
    </div>
  );
}

That's it. The hook handles PKCE, the Google redirect, token exchange, and persisting the user's identity.

Callback route (Next.js only)

Vite and other SPAs handle the callback automatically — no extra setup.

Next.js needs a page at the callback path so it doesn't 404:

app/auth/callback/page.tsx
"use client";
import { useShooAuth } from "@shoojs/react";

export default function ShooCallback() {
  useShooAuth();
  return <p>Signing in…</p>;
}

Next steps