import vk_sdk from 'vksdk'
import util from 'util'
import {logger} from './logger'

export const vk_api = new vk_sdk({
  appId: process.env.VK_GROUP_STATS_VK_APP_ID || 5878021,
  appSecret: process.env.VK_GROUP_STATS_VK_APP_SECRET,
  version: '5.62',
})
vk_api.on('http-error', error => {
  logger.error(`app can't request VK API: ${util.inspect(error)}`)
})
vk_api.on('parse-error', error => {
  logger.error(`VK API response is incorrect: ${util.inspect(error)}`)
})

import vk_api from 'node-vkapi'

export const vk_api_client = new vk_api({
  app: {
    id: process.env.VK_GROUP_STATS_VK_APP_ID || 5878021,
    secret: process.env.VK_GROUP_STATS_VK_APP_SECRET,
  },
  version: '5.62',
})

Correct an initialization of VK API
Correct an initialization of VK API
