[PR #1944] [MERGED] feat: add mapProfileToUser in vk #4084

Closed
opened 2026-03-13 11:31:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1944
Author: @MagicFun1241
Created: 3/22/2025
Status: Merged
Merged: 4/2/2025
Merged by: @Bekacru

Base: mainHead: feature/vk-map-profile-to-user


📝 Commits (2)

  • 874871e feat: mapProfileToUser in vk social-provider
  • c4099c7 Merge branch 'better-auth:main' into feature/vk-map-profile-to-user

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/social-providers/vk.ts (+4 -0)

📄 Description

Why?

It will allow to map profile in VK social-network provider like it already implemented in kick

Example:

export const auth = betterAuth({
  socialProviders: {
    vk: {
      clientId: process.env.VK_CLIENT_ID!, 
      clientSecret: process.env.VK_CLIENT_SECRET!, 

      mapProfileToUser: (profile) => {
        return {
          id: profile.user.user_id,
          firstName: profile.user.first_name,
          lastName: profile.user.last_name,
          middleName: profile.user.middle_name,

          email: profile.user.email,
          emailVerified: !!profile.user.email,

          image: profile.user.avatar,

          birthday: profile.user.birthday,
	  sex: profile.user.sex,
        };
      },
    },
  },
});

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/1944 **Author:** [@MagicFun1241](https://github.com/MagicFun1241) **Created:** 3/22/2025 **Status:** ✅ Merged **Merged:** 4/2/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `feature/vk-map-profile-to-user` --- ### 📝 Commits (2) - [`874871e`](https://github.com/better-auth/better-auth/commit/874871e4c5d86a50e5960c009c894a7fe182a9b3) feat: mapProfileToUser in vk social-provider - [`c4099c7`](https://github.com/better-auth/better-auth/commit/c4099c78e3f488bb4f755163b0c36731894467ef) Merge branch 'better-auth:main' into feature/vk-map-profile-to-user ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/social-providers/vk.ts` (+4 -0) </details> ### 📄 Description ### Why? It will allow to map profile in VK social-network provider like it already implemented in [kick](https://github.com/better-auth/better-auth/blob/94d2d0544a9e86998444911bef88abca196069a5/packages/better-auth/src/social-providers/kick.ts#L78) Example: ```typescript export const auth = betterAuth({ socialProviders: { vk: { clientId: process.env.VK_CLIENT_ID!, clientSecret: process.env.VK_CLIENT_SECRET!, mapProfileToUser: (profile) => { return { id: profile.user.user_id, firstName: profile.user.first_name, lastName: profile.user.last_name, middleName: profile.user.middle_name, email: profile.user.email, emailVerified: !!profile.user.email, image: profile.user.avatar, birthday: profile.user.birthday, sex: profile.user.sex, }; }, }, }, }); ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 11:31:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#4084