Additional Fields for user/session when using expo #1324

Closed
opened 2026-03-13 08:32:47 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @jpainam on GitHub (Jun 7, 2025).

There is no documentation on how to add additional fields when using expo.
on the server, i defined

betterAuth

with additional fields. how to do so in

lib/auth-client.ts

import { createAuthClient } from "better-auth/react";
import { expoClient } from "@better-auth/expo/client";
import * as SecureStore from "expo-secure-store";
 
export const authClient = createAuthClient({
    baseURL: "http://localhost:8081", // Base URL of your Better Auth backend.
    plugins: [
        expoClient({
            scheme: "expo",
            storagePrefix: "expo",
            storage: SecureStore,
        })
    ]
});
Originally created by @jpainam on GitHub (Jun 7, 2025). There is no documentation on how to add additional fields when using expo. on the server, i defined ``` betterAuth ``` with additional fields. how to do so in ```tsx lib/auth-client.ts import { createAuthClient } from "better-auth/react"; import { expoClient } from "@better-auth/expo/client"; import * as SecureStore from "expo-secure-store"; export const authClient = createAuthClient({ baseURL: "http://localhost:8081", // Base URL of your Better Auth backend. plugins: [ expoClient({ scheme: "expo", storagePrefix: "expo", storage: SecureStore, }) ] }); ```
Author
Owner

@jpainam commented on GitHub (Jun 8, 2025):

On the server

type Auth = ReturnType<typeof auth>;

On the client

export const authClient = createAuthClient({
  plugins: [inferAdditionalFields<Auth>()],
});
@jpainam commented on GitHub (Jun 8, 2025): On the server ```tsx type Auth = ReturnType<typeof auth>; ``` On the client ```tsx export const authClient = createAuthClient({ plugins: [inferAdditionalFields<Auth>()], }); ```
Author
Owner

@officialericbzink-creator commented on GitHub (Nov 5, 2025):

what if your server is a completely separate repository from your expo app?

@officialericbzink-creator commented on GitHub (Nov 5, 2025): what if your server is a completely separate repository from your expo app?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1324