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

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

Configure Log in with PayPal advanced settings

To configure Log in with PayPal: Go to your app in the Developer Dashboard, under 'Other features' check 'Log in with PayPal', click 'Advanced Settings', enter your Return URL, select the user information you want to access (email, name, etc.), and enter Privacy Policy and User Agreement URLs.

PayPal provider setup steps

To integrate with PayPal, follow these steps: Create an account on the PayPal Developer Portal, create a new application, configure Log in with PayPal under 'Other features', set up your Return URL (redirect URL), configure user information permissions, and note your Client ID and Client Secret.

PayPal sandbox vs live environments

PayPal has two environments: Sandbox for testing and Live for production. For testing, create sandbox test accounts in the Developer Dashboard under 'Sandbox' → 'Accounts'. You cannot use your real PayPal account to test in sandbox mode; you must use the generated test accounts.

PayPal Return URL configuration requirement

The Return URL in your PayPal app settings must exactly match your redirect URI. The PayPal API does not work with localhost. You need to use a public domain for the redirect URL and HTTPS for local testing. You can use NGROK or another similar tool for this.

PayPal permissions configuration method

PayPal does not use traditional OAuth2 scopes in the authorization URL. Instead, you configure permissions directly in the Developer Dashboard. For live apps, PayPal must review and approve your application before it can go live, which typically takes a few weeks.

PayPal provider configuration in Better Auth

To configure the PayPal provider in Better Auth, import betterAuth and pass it to the socialProviders option with clientId, clientSecret, and environment properties. Example: betterAuth({ socialProviders: { paypal: { clientId: process.env.PAYPAL_CLIENT_ID as string, clientSecret: process.env.PAYPAL_CLIENT_SECRET as string, environment: 'sandbox' } } })

PayPal provider options

The PayPal provider accepts these options: environment (type 'sandbox' | 'live', default 'sandbox') - PayPal environment to use; requestShippingAddress (type boolean, default false) - whether to request shipping address information.

PayPal signIn.social client implementation

To sign in with PayPal using the client, use the signIn.social function from createAuthClient with the provider set to 'paypal'. Example: const authClient = createAuthClient(); const data = await authClient.signIn.social({ provider: 'paypal' })

PayPal signIn.social additional options

The signIn.social function for PayPal accepts these additional options: environment (default 'sandbox', options 'sandbox' or 'live') - PayPal environment to use; requestShippingAddress (default false) - whether to request shipping address information; scope (default configured in PayPal Developer Dashboard) - additional scopes to request, noting that PayPal does not use traditional OAuth2 scopes as permissions are set in the Dashboard; mapProfileToUser - custom function to map PayPal profile data to user object; getUserInfo - custom function to retrieve user information; verifyIdToken - custom ID token verification function.

Give your agent this brain