Clerk: Is it possible to create custom metadata on signup using Clerk?

I need to create a custom metadata "credits" on each new user object, is it possible to achieve that with Clerk?

One of my ideas was to call the api route after sign up which will update user object using clerkClient.

await signUp.authenticateWithRedirect({
  strategy: provider,
  redirectUrl: '/dashboard',
  redirectUrlComplete: '/dashboard',
});

await fetch('...');


But fetch never get called because authenticateWithRedirect automatically redirects to the /dashboard as soon as sign up happens. Any ideas, how to achieve this? I need to create public metadata, so unsafeMetadata is not a solution.
Was this page helpful?