[GH-ISSUE #1855] Expo Client missing types for getCookie #8947

Closed
opened 2026-04-13 04:11:36 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @OmarMcAdam on GitHub (Mar 17, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1855

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Install better auth in expo
  2. use custom fetch method (trpc example in docs: https://www.better-auth.com/docs/integrations/expo#option-2-adding-the-cookie-to-request-headers )

check code linting for const cookies = authClient.getCookie();

Current vs. Expected behavior

expect no lint errors

What version of Better Auth are you using?

1.2.3

Provide environment information

MacOs latest

Which area(s) are affected? (Select all that apply)

Types

Auth config (if applicable)

export const authClient = createAuthClient({
  baseURL: authUrl,
  plugins: [
    emailOTPClient(),
    expoClient({
      scheme: "1up",
      storagePrefix: "1up",
      storage: SecureStore,
    }) as unknown as BetterAuthClientPlugin,
  ],
});

Additional context

The function works correctly, but types are not properly exported and result in a ts lint error:

Property 'getCookie' does not exist on type '{ emailOtp: { sendVerificationOtp: <FetchOptions extends { method?: string | undefined; headers?: any; credentials?: RequestCredentials_ | undefined; integrity?: string | undefined; ... 29 more ...; disableValidation?: boolean | undefined; }>(data_0: Prettify<...>, data_1?: FetchOptions | undefined) => Promise<...>;...'.ts(2339)
Originally created by @OmarMcAdam on GitHub (Mar 17, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1855 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Install better auth in expo 2. use custom fetch method (trpc example in docs: https://www.better-auth.com/docs/integrations/expo#option-2-adding-the-cookie-to-request-headers ) check code linting for `const cookies = authClient.getCookie();` ### Current vs. Expected behavior expect no lint errors ### What version of Better Auth are you using? 1.2.3 ### Provide environment information ```bash MacOs latest ``` ### Which area(s) are affected? (Select all that apply) Types ### Auth config (if applicable) ```typescript export const authClient = createAuthClient({ baseURL: authUrl, plugins: [ emailOTPClient(), expoClient({ scheme: "1up", storagePrefix: "1up", storage: SecureStore, }) as unknown as BetterAuthClientPlugin, ], }); ``` ### Additional context The function works correctly, but types are not properly exported and result in a ts lint error: ``` Property 'getCookie' does not exist on type '{ emailOtp: { sendVerificationOtp: <FetchOptions extends { method?: string | undefined; headers?: any; credentials?: RequestCredentials_ | undefined; integrity?: string | undefined; ... 29 more ...; disableValidation?: boolean | undefined; }>(data_0: Prettify<...>, data_1?: FetchOptions | undefined) => Promise<...>;...'.ts(2339) ```
GiteaMirror added the lockedbug labels 2026-04-13 04:11:36 -05:00
Author
Owner

@kuldeep-kth commented on GitHub (Mar 22, 2025):

+1

<!-- gh-comment-id:2745205113 --> @kuldeep-kth commented on GitHub (Mar 22, 2025): +1
Author
Owner

@juan-altatech commented on GitHub (Mar 31, 2025):

+1

<!-- gh-comment-id:2764966156 --> @juan-altatech commented on GitHub (Mar 31, 2025): +1
Author
Owner

@zwily commented on GitHub (Mar 31, 2025):

The problem here is the type casting as unknown as BetterAuthClientPlugin to a client plugin that doesn't include the getCookie() method. So the root of the problem is #2031, not that getCookie is missing from the type.

<!-- gh-comment-id:2766646630 --> @zwily commented on GitHub (Mar 31, 2025): The problem here is the type casting `as unknown as BetterAuthClientPlugin` to a client plugin that doesn't include the `getCookie()` method. So the root of the problem is #2031, not that `getCookie` is missing from the type.
Author
Owner

@Bekacru commented on GitHub (Apr 12, 2025):

should be fixed on 1.2.6

<!-- gh-comment-id:2799035662 --> @Bekacru commented on GitHub (Apr 12, 2025): should be fixed on `1.2.6`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8947