supermemory/packages
Dhravya 5d2b5855fe
feat(auth): AgentID sign-in button on the web login page (#1467)
## What?

Adds a "Continue with AgentID" button to the web app's login page, matching the existing Google/GitHub buttons (same `ExternalAuthButton` pattern, PostHog `login_attempt` capture, last-used badge).

- `packages/lib/auth.ts`: adds the `genericOAuthClient` plugin — generic OAuth providers sign in via `signIn.oauth2({ providerId })`, not `signIn.social`.
- `apps/web/app/(auth)/login/page.tsx`: the button, gated the same way as the other social buttons — always shown on cloud (`NEXT_PUBLIC_HOST_ID === "supermemory"`), opt-in elsewhere via `NEXT_PUBLIC_AGENTID_AUTH_ENABLED` (added to `.env.example`).

## Why?

Companion to supermemoryai/mono#2908, which registers an `agentid` generic OAuth provider (OIDC against auth.agentid.com) on the API so agents can authenticate with their AgentID identity. The consumer app talks to the same better-auth server, so it gets the same sign-in option. mono#2916 additionally auto-invites the agent's verified human owner to the agent's workspace.

Requires mono#2908 to be deployed for the button to work; until then the API rejects the unknown provider and the page shows its normal error state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches authentication entry points and OAuth client configuration; risk is moderate because it extends login surface area but follows existing social sign-in patterns and is feature-flagged.
>
> **Overview**
> Adds **Continue with AgentID** on the web login page, using the same `ExternalAuthButton` flow as Google/GitHub (PostHog `login_attempt`, last-used badge, loading/error handling).
>
> The button calls **`signIn.oauth2({ providerId: "agentid" })`** instead of `signIn.social`, enabled by registering **`genericOAuthClient`** on the shared better-auth client in `packages/lib/auth.ts`.
>
> Visibility matches other social providers: shown on cloud when `NEXT_PUBLIC_HOST_ID === "supermemory"`, or elsewhere when **`NEXT_PUBLIC_AGENTID_AUTH_ENABLED`** is set (documented in `.env.example`). Depends on the API registering the `agentid` generic OAuth provider.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 90a32786a3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-08-16 23:20:38 +00:00
..
agent-framework-python fix(agent-framework): restore importability on current agent-framework-core releases (#1281) 2026-07-17 14:49:10 +05:30
ai-sdk fix: username issue and bun lock issue (#818) 2026-03-31 21:41:25 +00:00
cartesia-sdk-python fix(cartesia-sdk): treat empty profile as no memories, not a retrieval error (#1164) 2026-07-10 19:14:49 -07:00
docs-test docs: restructure documentation site and update integration UI (#1331) 2026-07-21 20:19:30 -07:00
hooks fix: add type checks for TypeScript workspaces (#1447) 2026-08-13 17:55:50 +05:30
lib feat(auth): AgentID sign-in button on the web login page (#1467) 2026-08-16 23:20:38 +00:00
memory-graph fix(memory-graph): center arrow-key navigation in the visible graph area (#1337) 2026-08-12 20:56:23 +05:30
openai-sdk-python fix(openai-sdk): cap supermemory to <3.5 so a fresh install imports (#1236) 2026-08-12 20:56:54 +05:30
pipecat-sdk-python fix(pipecat-sdk): handle null profile object safely (#1041) 2026-06-05 17:26:28 +05:30
tools fix(tools): bound memory forget requests (#1451) 2026-08-13 19:11:00 +05:30
ui fix: add type checks for TypeScript workspaces (#1447) 2026-08-13 17:55:50 +05:30
validation fix: add type checks for TypeScript workspaces (#1447) 2026-08-13 17:55:50 +05:30