Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.0.0-beta.7 - Cannot export the User type #1810

Closed
6 tasks done
ltatakis-optaxe opened this issue Nov 19, 2024 · 2 comments
Closed
6 tasks done

v4.0.0-beta.7 - Cannot export the User type #1810

ltatakis-optaxe opened this issue Nov 19, 2024 · 2 comments

Comments

@ltatakis-optaxe
Copy link

ltatakis-optaxe commented Nov 19, 2024

Checklist

Description

I would like to be able to use the User type returned by import { useUser } from '@auth0/nextjs-auth0' in my code for typing. It does not seem however I can use it in my project.

In previous versions we were able to do

import { UserProfile, useUser } from '@auth0/nextjs-auth0/client'

Reproduction

Trying to import a type for the user from useUser hook

Additional context

No response

nextjs-auth0 version

v4.0.0-beta.7

Next.js version

15.0.3

Node.js version

v22.11.0

@guabu
Copy link

guabu commented Nov 19, 2024

Hey @ltatakis-optaxe 👋 You should be able to get the User type like so:

import { type SessionData } from "@auth0/nextjs-auth0/server";
type User = SessionData["user"];

We'll improve the type exports in the next release so you can directly import the the User type — thanks for bringing that up!

This was referenced Nov 24, 2024
@guabu
Copy link

guabu commented Nov 26, 2024

We consolidated the types to be available under the /types submodule and the User can now be imported as follows: import { User } from "@auth0/nextjs-auth0/types"; in 4.0.0-beta.8.

Thanks for the feedback and patience here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants