Social login on server

Can I user social sign in on server like:

const session = await auth.api.signInSocial({
      body: { provider, callbackURL },
    });

If I can, what's the proper way to do that? I'm currently using it inside a server action and better auth returns "Invalid URL" even though I've passed in the valid one to the callbackURL.
Was this page helpful?