orpc-better-auth-integration
Use Better Auth inside your oRPC projects without any extra overhead.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use Better Auth inside your oRPC projects without any extra overhead.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Quick reference for Better Notify configuration, patterns, and common gotchas
Interactive setup wizard for adding Better Notify to a TypeScript/JavaScript project
Context and API guidance for Better Notify — end-to-end typed notification infrastructure for Node.js
Seamlessly use AI SDK inside your oRPC projects without any extra overhead.
Use oRPC inside an Astro project.
Functions to encode and decode base64url strings (URL-safe variant of base64).
| name | oRPC Better Auth Integration |
| description | Use Better Auth inside your oRPC projects without any extra overhead. |
| license | MIT |
| metadata | {"author":"Ali Torki","homepage":"https://github.com/ali-master","version":"1.0.0"} |
Better Auth is a framework-agnostic, universal authentication and authorization framework for TypeScript.
Access request headers in your context — manually or via the Request Headers Plugin.
import { os } from '@orpc/server'
export const base = os.$context<{ headers: Headers }>()
Use the plugin's setup.
import { auth } from './auth' // Your Better Auth instance
import { base } from './context'
import { ORPCError } from '@orpc/server'
export const authMiddleware = base.middleware(async ({ context, next }) => {
const sessionData = await auth.api.getSession({
headers: context.headers,
})
if (!sessionData?.session || !sessionData?.user) {
throw new ORPCError('UNAUTHORIZED')
}
return next({
context: {
session: sessionData.session,
user: sessionData.user
},
})
})
Create an authorized base that includes the auth middleware:
import { base } from './context'
import { authMiddleware } from './middlewares/auth'
export const authorized = base.use(authMiddleware)
Now use it to create authenticated procedures:
import { authorized } from './authorized'
export const getMessages = authorized.handler(({ context }) => {
// context.session and context.user are guaranteed to be defined
})