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/vk

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

VK ID requires client ID and client secret

To use VK ID sign in, you need a client ID and client secret obtained from the VK ID Developer Portal at https://id.vk.com/about/business/go/docs.

VK ID redirect URL for local development

For local development, set the VK ID redirect URL to http://localhost:3000/api/auth/callback/vk. For production, set it to the URL of your application. If you change the base path of the auth routes, update the redirect URL accordingly.

Configure VK ID provider in Better Auth

Import betterAuth and configure the VK ID provider in the socialProviders option, passing clientId and clientSecret from environment variables. The configuration should set the provider key to 'vk' with clientId and clientSecret properties.

VK ID provider configuration code example

import { betterAuth } from "better-auth"; export const auth = betterAuth({ socialProviders: { vk: { clientId: process.env.VK_CLIENT_ID as string, clientSecret: process.env.VK_CLIENT_SECRET as string, }, }, });

Sign in with VK using signIn.social

To sign in with VK, use the signIn.social function from the auth client with the provider set to 'vk'.

VK ID client sign-in code example

import { createAuthClient } from "better-auth/client"; const authClient = createAuthClient(); const signIn = async () => { const data = await authClient.signIn.social({ provider: "vk", }); };

Give your agent this brain