Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vk-io/authorization

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vk-io/authorization

Separated module for authorization

  • 1.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

VK-IO Authorization

NPM version Build Status NPM downloads

VK-IO Authorization API - Separated module for authorization by login & password, and etc... ⚙️

📦 Installation

Node.js 12.20.0 or newer is required

  • Using npm (recommended)
    npm i @vk-io/authorization
    
  • Using Yarn
    yarn add @vk-io/authorization
    
  • Using pnpm
    pnpm add @vk-io/authorization
    

Example usage

import { CallbackService } from 'vk-io';
import { DirectAuthorization, officialAppCredentials } from '@vk-io/authorization';

const callbackService = new CallbackService();

const direct = new DirectAuthorization({
	callbackService,

	scope: 'all',

	// Direct authorization is only available for official applications
	...officialAppCredentials.android, // { clientId: string; clientSecret: string; }

	// Or manually provide app credentials
	// clientId: process.env.CLIENT_ID,
	// clientSecret: process.env.CLIENT_SECRET,

	login: process.env.LOGIN,
	password: process.env.PASSWORD,
	
	apiVersion: '5.131'
});

async function run() {
	const response = await direct.run();

	console.log('Token:', response.token);
	console.log('Expires:', response.expires);

	console.log('Email:', response.email);
	console.log('User ID:', response.userId);
}

run().catch(console.error);

Additional info

The module also supports ImplicitFlowUser, ImplicitFlowGroup and AccountVerification

Keywords

FAQs

Package last updated on 31 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc