How can I connect to Convex from Flutter?

Hello. I’m working on developing NextJS and Flutter apps. I’ve created a backend using Convex in NextJS. When calling the NextJS API from the Flutter app, I encounter errors with user authentication. Despite using the same Auth0 domain, how can I pass the authenticated user information from the API to Convex? await ctx.auth.getUserIdentity() returns null.

NextJS code

export const getUser = query({
  handler: async (ctx) => {
    const identity = await ctx.auth.getUserIdentity();

    return identity

export async function GET() {
  const user = await fetchQuery(api.users.getUser);
  return NextResponse.json(user);

Flutter code

Future<void> getUserAction(UserProfile? user) async {
    print("userId: ${user?.sub}");
    final url = Uri.parse('');
    try {
      final response = await http.get(url);

      if (response.statusCode == 200) {
      } else {
        print('Failed to load data');
    } catch (e) {
      print('Error: $e');