new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · Authentication · all subjects

social sign-on/polar

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Polar OAuth credentials location

To use Polar sign in, credentials are obtained from the Polar User Settings at https://polar.sh/dashboard/account/developer or https://polar.sh/settings#oauth.

Polar OAuth Client creation steps

To create a Polar OAuth 2.0 Client: go to Polar User Settings, click 'Create OAuth Client', fill in Application Name, Client Type, Redirect URIs, and Scopes (openid, profile, email are default). Optionally add logo, terms of service URL, and privacy policy URL. After creation, copy the Client ID and Client Secret.

Polar redirect URI format

For local development, set Polar redirect URI to http://localhost:3000/api/auth/callback/polar. For production, set it to https://yourdomain.com/api/auth/callback/polar. If the base path of the auth routes is changed, update the redirect URI accordingly.

Polar provider configuration in Better Auth

To configure Polar as a social provider in Better Auth, import betterAuth and pass the provider configuration to the socialProviders option. The configuration requires clientId and clientSecret from environment variables: polar: { clientId: process.env.POLAR_CLIENT_ID as string, clientSecret: process.env.POLAR_CLIENT_SECRET as string }.

Polar sign-in implementation with Better Auth client

To sign in with Polar using the Better Auth client, use the signIn.social function with the provider set to 'polar'. Example: const data = await authClient.signIn.social({ provider: 'polar' }).

Give your agent this brain