Skip to content

Commit

Permalink
Merge pull request #22 from ALTaww/patch-1
Browse files Browse the repository at this point in the history
Update README.md and README.ru.md
  • Loading branch information
Capster committed Mar 7, 2024
2 parents ec789ab + 1c6da3f commit 17e3a87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Русская версия](https://github.com/Capster/node-shikimori/blob/master/README.ru.md)

A TypeScript library that provides a simple and easy-to-use wrapper for accessing the [Shikimori API](https://shikimori.me/api/doc). The library supports all endpoints and types of the Shikimori API and provides OAuth2 authorization functionality using an access token.
A TypeScript library that provides a simple and easy-to-use wrapper for accessing the [Shikimori API](https://shikimori.one/api/doc). The library supports all endpoints and types of the Shikimori API and provides OAuth2 authorization functionality using an access token.

[![Build Status](https://img.shields.io/github/actions/workflow/status/Capster/node-shikimori/run-build.yml)](https://github.com/Capster/node-shikimori/actions/)
[![npm version](https://img.shields.io/npm/v/node-shikimori.svg)](https://www.npmjs.com/package/node-shikimori)
Expand All @@ -20,7 +20,7 @@ A TypeScript library that provides a simple and easy-to-use wrapper for accessin
## Documentation
See the node-shikimori [API documentation](https://capster.github.io/node-shikimori) rendered with TypeDoc.

See the [official documentation](https://shikimori.me/api/doc) for the Shikimori API.
See the [official documentation](https://shikimori.one/api/doc) for the Shikimori API.

## Installation
#### npm
Expand Down Expand Up @@ -48,13 +48,13 @@ console.log(result);
```

## Authorization
For more additional information see the [Official Shikimori OAuth2 Guide](https://shikimori.me/oauth).
For more additional information see the [Official Shikimori OAuth2 Guide](https://shikimori.one/oauth).

1. **Register your [Shikimori Application](https://shikimori.me/oauth/applications):** This will provide you with a `client_id` and `client_secret` that you will need to use OAuth2.
1. **Register your [Shikimori Application](https://shikimori.one/oauth/applications):** This will provide you with a `client_id` and `client_secret` that you will need to use OAuth2.

2. **Redirect user to the Shikimori authorization endpoint:** This endpoint will prompt the user to grant your application access to their resources. After the user grants access, Shikimori will redirect them back to your application with an *authorization code*.
```
https://shikimori.me/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&scope=
https://shikimori.one/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&scope=
```

3. **Get an access token:** Your application will need to exchange an *authorization code* for an `AccessToken`. Shikimori will respond with an access token that your application can use to access the restricted resources/endpoints.
Expand All @@ -63,7 +63,7 @@ import { auth } from 'node-shikimori';

const { getAccessToken } = auth({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECTET',
clientSecret: 'YOUR_CLIENT_SECRET',
});

const accessToken = await getAccessToken('YOUR_AUTH_CODE');
Expand Down
8 changes: 4 additions & 4 deletions README.ru.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Обертка над Shikimori API

Библиотека TypeScript, предоставляющая простую и удобную оболочку для доступа к [Shikimori API](https://shikimori.me/api/doc). Библиотека поддерживает все эндпоинты и типы Shikimori API, а также предоставляет функциональность по OAuth2-авторизации с использованием access-токена.
Библиотека TypeScript, предоставляющая простую и удобную оболочку для доступа к [Shikimori API](https://shikimori.one/api/doc). Библиотека поддерживает все эндпоинты и типы Shikimori API, а также предоставляет функциональность по OAuth2-авторизации с использованием access-токена.

[![Build Status](https://img.shields.io/github/actions/workflow/status/Capster/node-shikimori/run-build.yml)](https://github.com/Capster/node-shikimori/actions/)
[![npm version](https://img.shields.io/npm/v/node-shikimori.svg)](https://www.npmjs.com/package/node-shikimori)
Expand Down Expand Up @@ -46,9 +46,9 @@ console.log(result);
```

## Авторизация
Более подробную информацию можно посмотреть в [Official Shikimori OAuth2 Guide](https://shikimori.me/oauth).
Более подробную информацию можно посмотреть в [Official Shikimori OAuth2 Guide](https://shikimori.one/oauth).

1. **Зарегистрируйте ваше [приложение Шикимори](https://shikimori.me/oauth/applications):** После регистрации вам будут выданы `client_id` и `client_secret` которые понадобятся для использования OAuth2.
1. **Зарегистрируйте ваше [приложение Шикимори](https://shikimori.one/oauth/applications):** После регистрации вам будут выданы `client_id` и `client_secret` которые понадобятся для использования OAuth2.

2. **Перенаправьте пользователя на эндпоинт авторизации в Шикимори:** Этот эндпоинт предложит ему предоставить вашему приложению доступ к своим данным. После того, как пользователь предоставит доступ, Шикимори перенаправит его обратно в ваше приложение с *кодом авторизации*.
```
Expand All @@ -61,7 +61,7 @@ import { auth } from 'node-shikimori';

const { getAccessToken } = auth({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECTET',
clientSecret: 'YOUR_CLIENT_SECRET',
});

const accessToken = await getAccessToken('YOUR_AUTH_CODE');
Expand Down

0 comments on commit 17e3a87

Please sign in to comment.