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

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.

Hugging Face OAuth setup - credentials and redirect URL

To use Hugging Face sign in, obtain a client ID and client secret from Hugging Face OAuth documentation at https://huggingface.co/docs/hub/oauth. Ensure the created OAuth app has the 'email' scope. Set the redirect URL to http://localhost:3000/api/auth/callback/huggingface for local development. For production, set it to your application's URL. If you change the base path of the auth routes, update the redirect URL accordingly.

Hugging Face provider configuration in auth instance

To configure Hugging Face as a provider, import better-auth and pass the provider configuration to the socialProviders option. The configuration requires clientId and clientSecret from environment variables.

Hugging Face provider configuration code example

This example shows how to configure Hugging Face as a social provider in auth.ts: import { betterAuth } from "better-auth" export const auth = betterAuth({ socialProviders: { huggingface: { clientId: process.env.HUGGINGFACE_CLIENT_ID as string, clientSecret: process.env.HUGGINGFACE_CLIENT_SECRET as string, }, }, })

Sign in with Hugging Face using signIn.social

To sign in with Hugging Face, use the signIn.social function from the auth client. Pass an object with the provider property set to 'huggingface'.

Hugging Face sign in code example

This example shows how to implement Hugging Face sign in on the client side: import { createAuthClient } from "better-auth/client" const authClient = createAuthClient() const signIn = async () => { const data = await authClient.signIn.social({ provider: "huggingface" }) }

Give your agent this brain