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

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

TikTok provider setup credentials and portal

To integrate TikTok authentication, create an account in the TikTok Developer Portal at https://developers.tiktok.com/apps, create a new application, set up a sandbox environment for testing, configure a redirect URL (must be HTTPS), and note the Client Secret and Client Key.

TikTok redirect URL requirements

The TikTok API does not work with localhost. The redirect URL must use a public HTTPS domain. For local testing, tools like NGROK can be used to provide a public domain. For production, the redirect URL should point to the URL of the application. If the base path of auth routes changes, the redirect URL must be updated accordingly.

TikTok sandbox mode for testing

For testing, use Sandbox mode which can be enabled in the TikTok Developer Portal.

TikTok default scope

The default scope for TikTok authentication is `user.info.profile`. Additional scopes are available as documented in the TikTok API scopes documentation.

TikTok API email limitation and workaround

The TikTok API does not provide email addresses. As a workaround, the user's `username` value is used for the `email` field, which is why the `user.info.profile` scope is required instead of just `user.info.basic`. For production use, approval from TikTok is required for the scopes you intend to use.

TikTok provider configuration

To configure the TikTok provider in Better Auth, import betterAuth and pass the provider configuration to the socialProviders option with clientSecret and clientKey environment variables: socialProviders: { tiktok: { clientSecret: process.env.TIKTOK_CLIENT_SECRET as string, clientKey: process.env.TIKTOK_CLIENT_KEY as string } }

TikTok sign-in usage

To sign in with TikTok using the client, call authClient.signIn.social({ provider: "tiktok" }).

Give your agent this brain