Skip to content

Instantly share code, notes, and snippets.

@mmikhan
Last active May 5, 2025 11:10
Show Gist options
  • Save mmikhan/672518b216d7e33cb4999ce88fb26b7d to your computer and use it in GitHub Desktop.
Save mmikhan/672518b216d7e33cb4999ce88fb26b7d to your computer and use it in GitHub Desktop.
Infer the output type directly from the Better Auth API function
// Infer the output type directly from the Better Auth API function
type ListUsersOutputType = Awaited<ReturnType<typeof auth.api.listUsers>>;
// Implementation
// Use z.custom for non-Zod types or refine further if needed
.output(z.custom<ListUsersOutputType>())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment