Scan your whole stack
From OX Research Newsroom
Are you using @o/better-auth-utils?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.16.21-canary.1795564333132
@o/better-auth-utils was last scanned on 24 Nov 2026 at version 0.16.21-canary.1795564333132. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.16.21-canary.1795564333132 LATEST | 24 Nov 2026 | No rules fired |
| 0.16.21-canary.1795556921493 | 24 Nov 2026 | No rules fired |
| 0.16.21-canary.1795497004712 | 24 Nov 2026 | Not shown |
| 0.16.21-canary.1795496674195 | 24 Nov 2026 | Not shown |
| 0.16.21-canary.1795495690804 | 24 Nov 2026 | Not shown |
Findings for v0.16.21-canary.1795564333132. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.16.21-canary.1795564333132; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Auth utilities for better-auth with React/React Native support.
bun add @o/better-auth-utils
import { createBetterAuthClient } from '@o/better-auth-utils'
const auth = createBetterAuthClient({
baseURL: 'https://myapp.com',
plugins: [
/* better-auth plugins */
],
// transform user object with app-specific fields
createUser: (user) => ({ ...user, role: user.role as 'admin' | undefined }),
// optional callbacks
onAuthStateChange: (state) => console.log('Auth changed:', state),
onAuthError: (error) => console.error('Auth error:', error),
})
// React hook for auth state
const { state, user, token } = auth.useAuth()
// get current auth state (non-reactive)
const { loggedIn } = auth.getAuth()
// clear all auth (localStorage + cookies)
auth.clearAllAuth()
// clear just localStorage token
auth.clearAuthClientToken()
| Option | Type | Default | Description |
|---|---|---|---|
baseURL |
string |
required | Auth server URL |
plugins |
array |
[] |
better-auth client plugins |
createUser |
function |
identity | Transform user object with app-specific typing |
onAuthStateChange |
function |
- | Callback when auth state changes |
onAuthError |
function |
- | Callback for auth errors |
storagePrefix |
string |
'auth' |
localStorage key prefix |
retryDelay |
number |
4000 |
Retry delay after errors (ms) |
tokenValidationEndpoint |
string |
'/api/auth/validateToken' |
JWT validation endpoint |
authCookieNames |
string[] |
['better-auth.jwt', 'better-auth.session_token'] |
Cookie names to clear on clearAllAuth() |
useAuth() - React hook returning { state, user, session, token }getAuth() - Get current auth state (non-reactive), includes loggedIn booleansetAuthClientToken({ token, session }) - Set auth token and sessionclearAuthClientToken() - Clear localStorage token onlyclearAllAuth() - Clear localStorage AND cookiesclearState() - Clear all auth state and storagegetValidToken() - Get valid JWT, refreshing if neededauthState - Emitter for subscribing to auth changesauthClientVersion - Emitter that updates when auth client recreatesimport { validateToken, isValidJWT, InvalidTokenError } from '@o/better-auth-utils/server'
// validate JWT against JWKS endpoint
try {
const payload = await validateToken(token, {
baseUrl: 'https://myapp.com',
forceIssuer: process.env.FORCE_ISSUER, // optional, for CI
jwksPath: '/api/auth/jwks', // optional, default
})
console.log('User ID:', payload.sub)
} catch (err) {
if (err instanceof InvalidTokenError) {
// token invalid (malformed, expired, signature mismatch, etc)
return Response.json({ error: 'INVALID_TOKEN' }, { status: 401 })
}
}
// simple boolean check
const valid = await isValidJWT(token, { baseUrl: 'https://myapp.com' })
| Export | Description |
|---|---|
validateToken(token, options) |
Validate JWT against JWKS, returns payload |
isValidJWT(token, options) |
Boolean validation check |
InvalidTokenError |
Error thrown for invalid tokens |
The server validates JWTs against the JWKS endpoint (/api/auth/jwks by default). A fresh JWKS is fetched for each validation to avoid stale key cache issues.
MIT
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.