0.0.4 • Published 4 years ago

react-vkontakte-login v0.0.4

Weekly downloads
17
License
MIT
Repository
github
Last release
4 years ago

React Vk Login

A Component React for Vk Login

Getting Started

git clone https://github.com/msklyarov/react-vkontakte-login.git && cd react-vkontakte-login
npm install react react-dom react-vkontakte-login --save --force

Development

npm start

How to use

Basic

import React from 'react';
import ReactDOM from 'react-dom';
import VkLogin from 'react-vkontakte-login';

const responseVk = response => {
  console.log(response);
};

ReactDOM.render(
  <VkLogin
    apiId="5376167"
    callback={responseVk}
    render={renderProps => (
      <button onClick={renderProps.onClick}>This is my custom VK button</button>
    )}
  />,
  document.getElementById('demo'),
);

Parameters

paramsvaluedefault value
appIdstringRequired
sizestringsmall - medium - metro
scopestringpublic_profile, email, user_birthday
fieldsstringname,email,picture
callbackfunctionresultVkLogin
autoLoadbooleanfalse
xfbmlbooleanfalse
reAuthenticatebooleanfalse
textButtonstringLogin with Vk
cssClassstringkep-login-facebook kep-login-facebook-button-size
redirectUristringwindow.location.href (mobile-only)
versionstring2.3
iconstringelementnone
languagestringen_US
onClickfunctionInitial click on the component