Skip to report

Popup OAuth sign-in arrives as a Better Auth plugin

Follow the new oauth-popup plugin into Better Auth’s client and plugin exports, completing OAuth sign-in in a popup without redirecting the opener.

better-auth/better-auth #9890 · PR by bytaesu · Merged

better-auth/better-auth 2ac00fe4..c14b9b0c

base and head as given

  • Popup OAuth sign-in entered the authentication library as a new plugin.
  • Client plugin exports now depend on popup OAuth.
  • Server plugin exports now depend on popup OAuth.
  • Popup OAuth exposes 17 new public APIs.
files changed
11
in a component
7
lines in components
781
components
3
public routes changed
0
schema statements
0
new dependencies
0
excluded by role
4
Based on 7 of 7 eligible changed files
Files changed in 3 components. Dependencies shown: 2 new
new · 21 component added

2 new dependencies between components — Client → OAuth Popup · Plugins → OAuth Popup

What else could behave differently

5 components · 8 files

These components import changed code, directly or through other files. A traced dependency is a place to review, not a confirmed runtime failure.

Reached 3

ComponentSymbolCited atFilesReached by
Clientpackages/better-auth/src/client/Added 1 of 9 changed symbols reaching itpackages/better-auth/src/plugins/oauth-popup/constants.ts:21none direct · 1 at two steps
Trace path

Shortest component path from the changed symbol:

  1. OAuth Popup
  2. Client

Later steps follow file imports; they do not prove this symbol is called.

Pluginspackages/better-auth/src/plugins/Added 1 of 6 changed symbols reaching itpackages/better-auth/src/plugins/oauth-popup/constants.ts:21none direct · 1 at two steps
Trace path

Shortest component path from the changed symbol:

  1. OAuth Popup
  2. Plugins

Later steps follow file imports; they do not prove this symbol is called.

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/Added 1 of 9 changed symbols reaching itpackages/better-auth/src/plugins/oauth-popup/constants.ts:233 direct
Trace path

Shortest component path from the changed symbol:

  1. OAuth Popup

Later steps follow file imports; they do not prove this symbol is called.

Held back 2

ComponentFilesReached byResolution
packages/better-auth/src/test-utils/2none direct · 1 at three steps · 1 at four stepsprecise
packages/better-auth/src/plugins/custom-session/1none direct · 1 at three stepsprecise

Statements 3

Adding the OAUTH_POPUP_MESSAGE_TYPE export reached 1 file in Client; all 4 names in its file changed. 1
packages/better-auth/src/plugins/oauth-popup/constants.ts:2
Adding the OAUTH_POPUP_MESSAGE_TYPE export reached 1 file in Plugins; all 4 names in its file changed. 1
packages/better-auth/src/plugins/oauth-popup/constants.ts:2
Adding the OAUTH_POPUP_MESSAGE_TYPE export reached 3 files in OAuth Popup; all 4 names in its file changed. 3
packages/better-auth/src/plugins/oauth-popup/constants.ts:2

68 reached files belong to no component — tests, docs and config.

Routes, schema, dependencies

No public URL, no migration and no new package.

Not stated

  • 2 import edges resolve to more than one file. A reach that passes through one is held back rather than claimed, and said so where it is listed.
  • 28 routes were found on files whose role excludes them, so no route is claimed for them.
  • 5 database accesses were found on files whose role excludes them, and no data claim states them.

Inspect components, files and symbols

Component

ClientModified
packages/better-auth/src/client/

1 file · 1 line

5 dependents

PluginsModified
packages/better-auth/src/plugins/

1 file · 1 line

1 dependent

OAuth PopupAdded
packages/better-auth/src/plugins/oauth-popup/

5 files · 779 lines

2 dependents

The OAuth Popup export surface added OAUTH_POPUP_COMPLETE_SCRIPT, OAUTH_POPUP_DATA_ELEMENT_ID, OAUTH_POPUP_ERROR_CODES, OAUTH_POPUP_MESSAGE_TYPE, OAUTH_POPUP_SCRIPT_CSP_HASH, OAuthPopupData, OAuthPopupError, OAuthPopupMessage, POPUP_MARKER_COOKIE, POPUP_TOKEN_STORAGE_KEY, SignInPopupOptions, SignInPopupResult, createSignInPopup, getStoredPopupToken, oauthPopup, oauthPopupClient, and popupBearerFetchPlugin.

File

Clientpackages/better-auth/src/client/
packages/better-auth/src/client/plugins/index.ts

+1 −0

Pluginspackages/better-auth/src/plugins/
packages/better-auth/src/plugins/index.ts

+1 −0

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/index.ts

+366 −0

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/client.ts

+365 −0

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/types.ts

+29 −0

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/constants.ts

+11 −0

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/error-codes.ts

+8 −0

Function

imports what changeddownstream of it, one mark per step

OAUTH_POPUP_MESSAGE_TYPE()packages/better-auth/src/plugins/oauth-popup/constants.ts

reaches 2 components

Adding the OAUTH_POPUP_MESSAGE_TYPE export reached 2 files in Test Utils; all 4 names in its file changed. 11
packages/better-auth/src/plugins/oauth-popup/constants.ts:2
Adding the OAUTH_POPUP_MESSAGE_TYPE export reached 1 file in Custom Session; all 4 names in its file changed. 1
packages/better-auth/src/plugins/oauth-popup/constants.ts:2

Diff

Clientpackages/better-auth/src/client/
packages/better-auth/src/client/plugins/index.ts

21–21

Pluginspackages/better-auth/src/plugins/
packages/better-auth/src/plugins/index.ts

18–18

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/index.ts

1–366

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/client.ts

1–365

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/types.ts

1–29

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/constants.ts

1–11

OAuth Popuppackages/better-auth/src/plugins/oauth-popup/
packages/better-auth/src/plugins/oauth-popup/error-codes.ts

1–8

Analysis scope

1898 → 3
  1. 1,898
    files at head
  2. 121
    components
  3. 3
    changed by this change

Where the new files landed

5 new files
New fileBelongs toUsed byCallsServes
packages/better-auth/src/plugins/oauth-popup/5 new files
OAuth Popupnew territory
ClientPlugins
packages/better-auth/src/packages/better-auth/src/api/state/packages/better-auth/src/context/packages/better-auth/src/cookies/packages/better-auth/src/crypto/packages/better-auth/src/utils/

4 added files carry no component — 2 docs, 2 test.

3components changed
2reached, not changed
1components added/removed
8dependencies added between components
0dependencies removed between components
0files moved to another path

11 files changed, 9 claims stated. 5 components reached in total.

naming: “model

narrative: “model

analyzer 0.2.0, config v1.9.0-phase8

Every line above is derived from 2ac00fe4..c14b9b0c and nothing else.