Generate Oauth/Social sign in links server side
I'm just getting started with better-auth and have what might be a basic question.
I want to generate a sign in link on my server. What is the correct API method to do that?
e.g. I want a URL for a "sign in to google" button that I can include in my server side template (either in a form as the form action, or as a link URL)
Solution:Jump to solution
You do need to follow the setup guide for the authentication provider you wish to use: https://www.better-auth.com/docs/authentication/google
all client calls can be access on the auth.api and the options you would usally pass to the client call like:
```ts...
Google | Better Auth
Google provider setup and usage.
API | Better Auth
Better Auth API.
2 Replies
Next.js example for microsoft
Solution
You do need to follow the setup guide for the authentication provider you wish to use: https://www.better-auth.com/docs/authentication/google
all client calls can be access on the auth.api and the options you would usally pass to the client call like:
becomes
see more documentation here
Google | Better Auth
Google provider setup and usage.
API | Better Auth
Better Auth API.