šŸ“„ next-auth/v3/providers/vk

File: vk.md | Updated: 11/15/2025

Source: https://next-auth.js.org/v3/providers/vk

Skip to main content

šŸŽ‰ NextAuth.js is now part of Better Auth !

This is documentation for NextAuth.js v3, which is no longer actively maintained.

For up-to-date documentation, see the **latest version ** (v4).

Version: v3

On this page

Documentation​


https://vk.com/dev/first_guide

Configuration​


https://vk.com/apps?act=manage

Options​


The VK Provider comes with a set of default options:

You can override any of the options to suit your own use case.

Example​


import Providers from `next-auth/providers`...providers: [  Providers.VK({    clientId: process.env.VK_CLIENT_ID,    clientSecret: process.env.VK_CLIENT_SECRET  })]...

note

By default the provider uses 5.126 version of the API. See https://vk.com/dev/versions for more info.

If you want to use a different version, you can pass it to provider's options object:

// pages/api/auth/[...nextauth].jsconst apiVersion = "5.126"...providers: [  Providers.VK({    accessTokenUrl: `https://oauth.vk.com/access_token?v=${apiVersion}`,    requestTokenUrl: `https://oauth.vk.com/access_token?v=${apiVersion}`,    authorizationUrl:      `https://oauth.vk.com/authorize?response_type=code&v=${apiVersion}`,    profileUrl: `https://api.vk.com/method/users.get?fields=photo_100&v=${apiVersion}`,  })]...