Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / Auth | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / Auth | ||
@@ -3,0 +3,0 @@ # Class: Auth |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [core/config](../modules/core_config.md) / Config | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [core/config](../modules/core_config.md) / Config | ||
@@ -3,0 +3,0 @@ # Class: Config |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/floatingOneTap](../modules/widgets_floatingOneTap.md) / FloatingOneTap | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/floatingOneTap](../modules/widgets_floatingOneTap.md) / FloatingOneTap | ||
@@ -3,0 +3,0 @@ # Class: FloatingOneTap |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/oauthList](../modules/widgets_oauthList.md) / OAuthList | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/oauthList](../modules/widgets_oauthList.md) / OAuthList | ||
@@ -3,0 +3,0 @@ # Class: OAuthList |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/oneTap](../modules/widgets_oneTap.md) / OneTap | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/oneTap](../modules/widgets_oneTap.md) / OneTap | ||
@@ -3,0 +3,0 @@ # Class: OneTap |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / AuthErrorCode | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / AuthErrorCode | ||
@@ -3,0 +3,0 @@ # Enumeration: AuthErrorCode |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / Languages | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / Languages | ||
@@ -3,0 +3,0 @@ # Enumeration: Languages |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / Scheme | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / Scheme | ||
@@ -3,0 +3,0 @@ # Enumeration: Scheme |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/floatingOneTap](../modules/widgets_floatingOneTap.md) / FloatingOneTapContentId | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/floatingOneTap](../modules/widgets_floatingOneTap.md) / FloatingOneTapContentId | ||
@@ -3,0 +3,0 @@ # Enumeration: FloatingOneTapContentId |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/oauthList](../modules/widgets_oauthList.md) / OAuthName | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/oauthList](../modules/widgets_oauthList.md) / OAuthName | ||
@@ -3,0 +3,0 @@ # Enumeration: OAuthName |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / AuthError | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / AuthError | ||
@@ -3,0 +3,0 @@ # Interface: AuthError |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / AuthParams | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / AuthParams | ||
@@ -3,0 +3,0 @@ # Interface: AuthParams |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / AuthResponse | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / AuthResponse | ||
@@ -3,0 +3,0 @@ # Interface: AuthResponse |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [core/config](../modules/core_config.md) / ConfigData | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [core/config](../modules/core_config.md) / ConfigData | ||
@@ -3,0 +3,0 @@ # Interface: ConfigData |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/floatingOneTap](../modules/widgets_floatingOneTap.md) / FloatingOneTapIndent | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/floatingOneTap](../modules/widgets_floatingOneTap.md) / FloatingOneTapIndent | ||
@@ -3,0 +3,0 @@ # Interface: FloatingOneTapIndent |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/floatingOneTap](../modules/widgets_floatingOneTap.md) / FloatingOneTapParams | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/floatingOneTap](../modules/widgets_floatingOneTap.md) / FloatingOneTapParams | ||
@@ -3,0 +3,0 @@ # Interface: FloatingOneTapParams |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/oauthList](../modules/widgets_oauthList.md) / OAuthListParams | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/oauthList](../modules/widgets_oauthList.md) / OAuthListParams | ||
@@ -3,0 +3,0 @@ # Interface: OAuthListParams |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/oauthList](../modules/widgets_oauthList.md) / OAuthListStyles | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/oauthList](../modules/widgets_oauthList.md) / OAuthListStyles | ||
@@ -3,0 +3,0 @@ # Interface: OAuthListStyles |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/oneTap](../modules/widgets_oneTap.md) / OneTapParams | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/oneTap](../modules/widgets_oneTap.md) / OneTapParams | ||
@@ -3,0 +3,0 @@ # Interface: OneTapParams |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / [widgets/oneTap](../modules/widgets_oneTap.md) / OneTapStyles | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / [widgets/oneTap](../modules/widgets_oneTap.md) / OneTapStyles | ||
@@ -3,0 +3,0 @@ # Interface: OneTapStyles |
@@ -1,4 +0,4 @@ | ||
[@vkid/sdk - v1.0.0](README.md) / Modules | ||
[@vkid/sdk - v1.0.1](README.md) / Modules | ||
# @vkid/sdk - v1.0.0 | ||
# @vkid/sdk - v1.0.1 | ||
@@ -5,0 +5,0 @@ ## Table of contents |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / auth | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / auth | ||
@@ -3,0 +3,0 @@ # Module: auth |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / core/config | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / core/config | ||
@@ -3,0 +3,0 @@ # Module: core/config |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / types | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / types | ||
@@ -3,0 +3,0 @@ # Module: types |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / widgets/floatingOneTap | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / widgets/floatingOneTap | ||
@@ -3,0 +3,0 @@ # Module: widgets/floatingOneTap |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / widgets/oauthList | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / widgets/oauthList | ||
@@ -3,0 +3,0 @@ # Module: widgets/oauthList |
@@ -1,2 +0,2 @@ | ||
[@vkid/sdk - v1.0.0](../README.md) / [Modules](../modules.md) / widgets/oneTap | ||
[@vkid/sdk - v1.0.1](../README.md) / [Modules](../modules.md) / widgets/oneTap | ||
@@ -3,0 +3,0 @@ # Module: widgets/oneTap |
@@ -8,2 +8,5 @@ @vkid/sdk / [Modules](modules.md) | ||
<p align="center"> | ||
<a href="https://npmjs.com/package/@vkid/sdk"> | ||
<img src="https://img.shields.io/badge/stability-beta-red"> | ||
</a> | ||
<a href="LICENSE"> | ||
@@ -19,3 +22,3 @@ <img src="https://img.shields.io/npm/l/@vkid/sdk?maxAge=3600"> | ||
<a href="https://npmjs.com/package/@vkid/sdk"> | ||
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/%40vkid%2Fsdk"> | ||
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/%40vkid%2Fsdk@latest"> | ||
</a> | ||
@@ -28,6 +31,8 @@ </p> | ||
## Демонстрация | ||
--- | ||
Чтобы изучить возможности VK ID SDK, перейдите на [демо-стенд](https://id.vk.com/about/business/demo) | ||
:information_source: VK ID SDK сейчас находится в бета-тестировании. О проблемах вы можете сообщить с помощью <a href="https://github.com/VKCOM/vkid-web-sdk/issues">issues репозитория</a>. | ||
--- | ||
## Установка | ||
@@ -59,3 +64,3 @@ | ||
> Обратите внимание: Для работы авторизации нужен APP_ID. Вы получите его, когда [создадите](https://id.vk.com/business/go/docs/vkid/latest/create-application) приложение в кабинете подключения VK ID. | ||
> Обратите внимание: Для работы авторизации нужен APP_ID. Вы получите его, когда [создадите](https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/connection/create-application) приложение в кабинете подключения VK ID. | ||
@@ -70,3 +75,6 @@ ## Пример | ||
VKID.Config.set({ app: APP_ID, redirectUrl: 'https://example.com' }); | ||
VKID.Config.set({ | ||
app: APP_ID, | ||
redirectUrl: 'https://example.com' | ||
}); | ||
@@ -89,21 +97,12 @@ const authButton = document.createElement('button'); | ||
VKID.Config.set({ | ||
app: APP_ID | ||
app: APP_ID, | ||
redirectUrl: 'https://example.com' | ||
}); | ||
const handleSuccess = ({ token }) => { | ||
console.log(token); | ||
} | ||
const oneTap = new VKID.OneTap(); | ||
const handleError = (error) => { | ||
console.log(error); | ||
} | ||
const vkIdOneTap = new VKID.OneTap(); | ||
vkIdOneTap.on(VKID.OneTapPublicEvents.LOGIN_SUCCESS, handleSuccess); | ||
vkIdOneTap.on(VKID.OneTapPublicEvents.LOGIN_FAILED, handleError); | ||
const container = document.getElementById('VkIdSdkOneTap'); | ||
if (container) { | ||
vkIdOneTap.render({ container: container }); | ||
oneTap.render({ container }); | ||
} | ||
@@ -115,5 +114,5 @@ ``` | ||
- [Что такое VK ID](https://id.vk.com/business/go/docs/vkid/latest/start-page) | ||
- [Создание приложения](https://id.vk.com/business/go/docs/vkid/latest/create-application) | ||
- [Требования к дизайну](https://id.vk.com/business/go/docs/vkid/latest/guidelines/design-rules) | ||
- [Что такое VK ID](https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/intro/start-page) | ||
- [Создание приложения](https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/connection/create-application) | ||
- [Требования к дизайну](https://id.vk.com/business/go/docs/ru/vkid/archive/1.60/vk-id/guidelines/design-rules) | ||
- [Спецификация](.wiki/README.md) | ||
@@ -120,0 +119,0 @@ |
'use strict'; | ||
// @ts-ignore-next-line пробрасываем версию из package.json в rollup.config | ||
var VERSION = "1.0.0"; | ||
var VERSION = "1.0.1"; | ||
// @ts-ignore-next-line пробрасываем тип сборки из rollup.config | ||
@@ -6,0 +6,0 @@ var DOMAIN = "vk.com"; |
'use strict'; | ||
var index = require('./../../lib/nanoid/non-secure/index.js'); | ||
var bridge = require('../bridge/bridge.js'); | ||
@@ -11,2 +10,3 @@ var types$1 = require('../bridge/types.js'); | ||
var url = require('../../utils/url.js'); | ||
var uuid = require('../../utils/uuid.js'); | ||
var constants = require('./constants.js'); | ||
@@ -197,3 +197,3 @@ var events = require('./events.js'); | ||
_this = _super.call(this); | ||
_define_property(_assert_this_initialized(_this), "id", index.customAlphabet("qazwsxedcrfvtgbyhnujmikol", 6)()); | ||
_define_property(_assert_this_initialized(_this), "id", uuid.uuid()); | ||
_define_property(_assert_this_initialized(_this), "lang", void 0); | ||
@@ -353,4 +353,3 @@ _define_property(_assert_this_initialized(_this), "scheme", void 0); | ||
code_challenge_method: CODE_CHALLENGE_METHOD, | ||
origin: location.protocol + "//" + location.host, | ||
uuid: this.id | ||
origin: location.protocol + "//" + location.host | ||
}); | ||
@@ -357,0 +356,0 @@ return url.getVKIDUrl(this.vkidAppName, queryParams, config); |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var constants = require('../constants.js'); | ||
var uuid = require('./uuid.js'); | ||
@@ -61,2 +62,3 @@ function _define_property(obj, key, value) { | ||
var queryParams = _object_spread_props(_object_spread({}, params), { | ||
uuid: uuid.uuid(), | ||
v: constants.VERSION, | ||
@@ -63,0 +65,0 @@ sdk_type: "vkid", |
@@ -103,2 +103,26 @@ 'use strict'; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function(sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _object_spread_props(target, source) { | ||
source = source != null ? source : {}; | ||
if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function(key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
return target; | ||
} | ||
function _possible_constructor_return(self, call) { | ||
@@ -191,3 +215,7 @@ if (call && (_type_of(call) === "object" || typeof call === "function")) { | ||
{ | ||
this.openFullAuth(); | ||
var params = {}; | ||
if (event.params.screen) { | ||
params.screen = event.params.screen; | ||
} | ||
this.openFullAuth(params); | ||
break; | ||
@@ -242,8 +270,7 @@ } | ||
key: "openFullAuth", | ||
value: function openFullAuth() { | ||
var params = { | ||
value: function openFullAuth(value) { | ||
var params = _object_spread_props(_object_spread({}, value), { | ||
lang: this.lang, | ||
screen: "phone", | ||
scheme: this.scheme | ||
}; | ||
}); | ||
FloatingOneTap.__auth.login(params); | ||
@@ -250,0 +277,0 @@ } |
@@ -102,2 +102,26 @@ 'use strict'; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function(sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _object_spread_props(target, source) { | ||
source = source != null ? source : {}; | ||
if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function(key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
return target; | ||
} | ||
function _possible_constructor_return(self, call) { | ||
@@ -186,3 +210,7 @@ if (call && (_type_of(call) === "object" || typeof call === "function")) { | ||
{ | ||
this.openFullAuth(); | ||
var params = {}; | ||
if (event.params.screen) { | ||
params.screen = event.params.screen; | ||
} | ||
this.openFullAuth(params); | ||
break; | ||
@@ -235,8 +263,7 @@ } | ||
key: "openFullAuth", | ||
value: function openFullAuth() { | ||
var params = { | ||
value: function openFullAuth(value) { | ||
var params = _object_spread_props(_object_spread({}, value), { | ||
lang: this.lang, | ||
screen: "phone", | ||
scheme: this.scheme | ||
}; | ||
}); | ||
OneTap.__auth.login(params); | ||
@@ -243,0 +270,0 @@ } |
// @ts-ignore-next-line пробрасываем версию из package.json в rollup.config | ||
const VERSION = "1.0.0"; | ||
const VERSION = "1.0.1"; | ||
// @ts-ignore-next-line пробрасываем тип сборки из rollup.config | ||
@@ -4,0 +4,0 @@ const DOMAIN = 'vk.com'; |
@@ -1,2 +0,1 @@ | ||
import { customAlphabet } from './../../lib/nanoid/non-secure/index.js'; | ||
import { Bridge } from '../bridge/bridge.js'; | ||
@@ -9,2 +8,3 @@ import { BridgeEvents } from '../bridge/types.js'; | ||
import { getVKIDUrl, getRedirectWithPayloadUrl } from '../../utils/url.js'; | ||
import { uuid } from '../../utils/uuid.js'; | ||
import { WIDGET_ERROR_TEXT } from './constants.js'; | ||
@@ -27,3 +27,3 @@ import { WidgetEvents } from './events.js'; | ||
static __auth; | ||
id = customAlphabet('qazwsxedcrfvtgbyhnujmikol', 6)(); | ||
id = uuid(); | ||
lang; | ||
@@ -143,4 +143,3 @@ scheme; | ||
code_challenge_method: CODE_CHALLENGE_METHOD, | ||
origin: location.protocol + '//' + location.host, | ||
uuid: this.id | ||
origin: location.protocol + '//' + location.host | ||
}; | ||
@@ -147,0 +146,0 @@ return getVKIDUrl(this.vkidAppName, queryParams, config); |
import { querystring } from '@vkontakte/vkjs'; | ||
import { VERSION } from '../constants.js'; | ||
import { uuid } from './uuid.js'; | ||
@@ -7,2 +8,3 @@ const getVKIDUrl = (module, params, config)=>{ | ||
...params, | ||
uuid: uuid(), | ||
v: VERSION, | ||
@@ -9,0 +11,0 @@ sdk_type: 'vkid', |
@@ -40,3 +40,7 @@ import { validator } from '../../core/validator/validator.js'; | ||
{ | ||
this.openFullAuth(); | ||
const params = {}; | ||
if (event.params.screen) { | ||
params.screen = event.params.screen; | ||
} | ||
this.openFullAuth(params); | ||
break; | ||
@@ -84,6 +88,6 @@ } | ||
} | ||
openFullAuth() { | ||
openFullAuth(value) { | ||
const params = { | ||
...value, | ||
lang: this.lang, | ||
screen: 'phone', | ||
scheme: this.scheme | ||
@@ -90,0 +94,0 @@ }; |
@@ -36,3 +36,7 @@ import { validator } from '../../core/validator/validator.js'; | ||
{ | ||
this.openFullAuth(); | ||
const params = {}; | ||
if (event.params.screen) { | ||
params.screen = event.params.screen; | ||
} | ||
this.openFullAuth(params); | ||
break; | ||
@@ -77,6 +81,6 @@ } | ||
} | ||
openFullAuth() { | ||
openFullAuth(value) { | ||
const params = { | ||
...value, | ||
lang: this.lang, | ||
screen: 'phone', | ||
scheme: this.scheme | ||
@@ -83,0 +87,0 @@ }; |
{ | ||
"name": "@vkid/sdk", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "VK ID Web SDK", | ||
@@ -33,2 +33,3 @@ "main": "dist-sdk/cjs/index.js", | ||
".wiki", | ||
"CHANGELOG.md", | ||
"CONTRIBUTING.md", | ||
@@ -35,0 +36,0 @@ "CODE_OF_CONDUCT.md", |
@@ -6,2 +6,5 @@ <div align="center"> | ||
<p align="center"> | ||
<a href="https://npmjs.com/package/@vkid/sdk"> | ||
<img src="https://img.shields.io/badge/stability-beta-red"> | ||
</a> | ||
<a href="LICENSE"> | ||
@@ -17,3 +20,3 @@ <img src="https://img.shields.io/npm/l/@vkid/sdk?maxAge=3600"> | ||
<a href="https://npmjs.com/package/@vkid/sdk"> | ||
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/%40vkid%2Fsdk"> | ||
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/%40vkid%2Fsdk@latest"> | ||
</a> | ||
@@ -26,6 +29,8 @@ </p> | ||
## Демонстрация | ||
--- | ||
Чтобы изучить возможности VK ID SDK, перейдите на [демо-стенд](https://id.vk.com/about/business/demo) | ||
:information_source: VK ID SDK сейчас находится в бета-тестировании. О проблемах вы можете сообщить с помощью <a href="https://github.com/VKCOM/vkid-web-sdk/issues">issues репозитория</a>. | ||
--- | ||
## Установка | ||
@@ -57,3 +62,3 @@ | ||
> Обратите внимание: Для работы авторизации нужен APP_ID. Вы получите его, когда [создадите](https://id.vk.com/business/go/docs/vkid/latest/create-application) приложение в кабинете подключения VK ID. | ||
> Обратите внимание: Для работы авторизации нужен APP_ID. Вы получите его, когда [создадите](https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/connection/create-application) приложение в кабинете подключения VK ID. | ||
@@ -68,3 +73,6 @@ ## Пример | ||
VKID.Config.set({ app: APP_ID, redirectUrl: 'https://example.com' }); | ||
VKID.Config.set({ | ||
app: APP_ID, | ||
redirectUrl: 'https://example.com' | ||
}); | ||
@@ -88,21 +96,12 @@ | ||
VKID.Config.set({ | ||
app: APP_ID | ||
app: APP_ID, | ||
redirectUrl: 'https://example.com' | ||
}); | ||
const handleSuccess = ({ token }) => { | ||
console.log(token); | ||
} | ||
const oneTap = new VKID.OneTap(); | ||
const handleError = (error) => { | ||
console.log(error); | ||
} | ||
const vkIdOneTap = new VKID.OneTap(); | ||
vkIdOneTap.on(VKID.OneTapPublicEvents.LOGIN_SUCCESS, handleSuccess); | ||
vkIdOneTap.on(VKID.OneTapPublicEvents.LOGIN_FAILED, handleError); | ||
const container = document.getElementById('VkIdSdkOneTap'); | ||
if (container) { | ||
vkIdOneTap.render({ container: container }); | ||
oneTap.render({ container }); | ||
} | ||
@@ -114,5 +113,5 @@ ``` | ||
- [Что такое VK ID](https://id.vk.com/business/go/docs/vkid/latest/start-page) | ||
- [Создание приложения](https://id.vk.com/business/go/docs/vkid/latest/create-application) | ||
- [Требования к дизайну](https://id.vk.com/business/go/docs/vkid/latest/guidelines/design-rules) | ||
- [Что такое VK ID](https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/intro/start-page) | ||
- [Создание приложения](https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/connection/create-application) | ||
- [Требования к дизайну](https://id.vk.com/business/go/docs/ru/vkid/archive/1.60/vk-id/guidelines/design-rules) | ||
- [Спецификация](.wiki/README.md) | ||
@@ -119,0 +118,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
593610
179
11782
124