Mo7aM
Convex Community3y ago
2 replies
Mo7a

No autocompletion for HTTP client

import { NextResponse } from "next/server";
import { ConvexHttpClient } from "convex/browser";
import { api } from "@/convex/_generated/api";

const client = new ConvexHttpClient(process.env.CONVEX_URL!);

export async function POST(req: Request) {
  const body = await req.json();
  await client.mutation(api.profiles.create, {
    userId: body.data.id,
    name,
    email: body.data.email_addresses[0].email_address,
    avatarUrl: body.data.profile_image_url,
  });
}


I have a problem the using this convex http client on the server on NextJs 13, I'm not getting any intellisense on the api. it's not working!
Was this page helpful?