Skip to content

Commit

Permalink
Release v2.0.0-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
VK ID authored and Aleksandr Kalish committed May 20, 2024
1 parent b85a6ef commit ed7c360
Show file tree
Hide file tree
Showing 131 changed files with 5,313 additions and 630 deletions.
2 changes: 2 additions & 0 deletions .eslintrc-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ module.exports = {
'@typescript-eslint/prefer-string-starts-ends-with': 'off',

'no-shadow': 'off',

'no-console': ['warn', { allow: ['warn', 'error'] }],
},
};
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

---

ℹ️ Версия VK ID SDK 2.0.0-alpha поддерживает авторизацию по протоколу [OAuth 2.1](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-10), а также способы входа через аккаунты Одноклассников и Mail.ru. Если вы хотите участвовать в тестировании этой версии SDK или узнать о ней подробнее, напишите нам на почту [email protected].

---

VK ID SDK сейчас находится в бета-тестировании. О проблемах вы можете сообщить с помощью <a href="https://github.com/VKCOM/vkid-web-sdk/issues">issues репозитория</a>.

---
Expand Down Expand Up @@ -53,7 +57,7 @@ pnpm add @vkid/sdk
**CDN:**

```html
<script src="https://unpkg.com/@vkid/sdk@latest/dist-sdk/umd/index.js"></script>
<script src="https://unpkg.com/@vkid/sdk@2.0.0-alpha/dist-sdk/umd/index.js"></script>
```

> Обратите внимание: Для работы авторизации нужен APP_ID. Вы получите его, когда [создадите](https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/connection/create-application) приложение в кабинете подключения VK ID.
Expand All @@ -66,15 +70,20 @@ pnpm add @vkid/sdk
```javascript
import * as VKID from '@vkid/sdk';

VKID.Config.set({
VKID.Config.init({
app: APP_ID,
redirectUrl: 'https://example.com'
redirectUrl: 'https://example.com',
state: 'state',
codeVerifier: 'codeVerifier',
scope: 'phone email',
});


const authButton = document.createElement('button');
authButton.onclick = () => {
VKID.Auth.login(); // После авторизации будет редирект на адрес, указанный в параметре redirect_uri
// После авторизации будет редирект на адрес, указанный в параметре redirectUrl
VKID.Auth.login()
.catch(console.error);
};

document.getElementById('container').appendChild(authButton);
Expand All @@ -87,26 +96,31 @@ document.getElementById('container').appendChild(authButton);
```javascript
import * as VKID from '@vkid/sdk';

VKID.Config.set({
VKID.Config.init({
app: APP_ID,
redirectUrl: 'https://example.com'
redirectUrl: 'https://example.com',
state: 'state',
codeVerifier: 'codeVerifier',
scope: 'phone email',
});

const oneTap = new VKID.OneTap();

const container = document.getElementById('VkIdSdkOneTap');

if (container) {
oneTap.render({ container });
oneTap
.render({ container })
.on(VKID.WidgetEvents.ERROR, console.error);
}
```
</details>

## Документация

- [Что такое 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)
- [Что такое VK ID](https://id.vk.com/about/business/go/docs/ru/vkid/latest/vk-id-2/intro/start-page)
- [Создание приложения](https://id.vk.com/about/business/go/docs/ru/vkid/latest/vk-id-2/connection/create-application)
- [Требования к дизайну](https://id.vk.com/about/business/go/docs/ru/vkid/latest/vk-id-2/connection/guidelines/design-rules-oauth)
- [Спецификация](https://vkcom.github.io/vkid-web-sdk/)

## Contributing
Expand Down
Loading

0 comments on commit ed7c360

Please sign in to comment.