-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from CrazyTapok-bit/develop
Added English language
- Loading branch information
Showing
29 changed files
with
748 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: Documentation | ||
index: false | ||
icon: book | ||
--- | ||
|
||
[![Testing Status](https://github.com/CrazyTapok-bit/tgWebValid/workflows/PHP%20CI/badge.svg)](https://github.com/CrazyTapok-bit/tgWebValid/actions) | ||
[![Minimum PHP Version](https://img.shields.io/packagist/dependency-v/tg/tgwebvalid/php)](https://packagist.org/packages/tg/tgwebvalid) | ||
[![Latest version](https://img.shields.io/packagist/v/tg/tgWebValid)](https://packagist.org/packages/tg/tgwebvalid) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/tg/tgwebvalid)](https://packagist.org/packages/tg/tgwebvalid) | ||
[![Total Stars](https://img.shields.io/packagist/stars/tg/tgwebvalid)](https://packagist.org/packages/tg/tgwebvalid) | ||
[![License](https://img.shields.io/packagist/l/tg/tgwebvalid)](https://packagist.org/packages/tg/tgwebvalid) | ||
|
||
[![StandWithUkraine](https://raw.githubusercontent.com/CrazyTapok-bit/tgWebValid/4.x/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua) | ||
[![StandWithUkraine](https://raw.githubusercontent.com/CrazyTapok-bit/tgWebValid/4.x/badges/RussianWarship.svg)](https://stand-with-ukraine.pp.ua) | ||
|
||
[![StandWithUkraine](https://raw.githubusercontent.com/CrazyTapok-bit/tgWebValid/4.x/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua) | ||
|
||
## About TgWebValid {#about} | ||
|
||
Our library is light, fast :rocket:, modern and has `100%` autocomplete for getting user data. At the same time, we made it autonomous, so its use is possible in any frameworks or without them. | ||
|
||
And most importantly, our library is designed to verify users of [Telegram Mini App](https://core.telegram.org/bots/webapps) and [Telegram Login Widget](https://core.telegram.org/widgets/login) on PHP | ||
|
||
Authentication occurs by encrypting the received raw user data and comparing it with a hash provided by Telegram. | ||
|
||
:::info Recommendation | ||
Provide access to sensitive user data **only after successful authentication** | ||
::: | ||
|
||
**Start verifying users quickly and securely.** | ||
|
||
:::tip Pay attention | ||
The average time to deploy the TgWebValid library in your project is **only ~ 1 min**. | ||
::: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Entities | ||
icon: database | ||
index: false | ||
dir: | ||
order: 3 | ||
--- | ||
|
||
<AutoCatalog /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
title: InitData | ||
icon: object-group | ||
dir: | ||
order: 1 | ||
--- | ||
|
||
This object contains the data that is passed to the applet when it is opened. This entity can only be accessed after successful user authentication using the validator [mini-app](../../validator/web-app.md). | ||
|
||
## Properties {#properties} | ||
|
||
### `queryId` | ||
|
||
- **Type:** `string` | ||
- **Default:** `null` | ||
|
||
__Optional._ A unique identifier for the Web App session | ||
|
||
### `user` | ||
|
||
- **Type:** [`TgWebValid\Entities\InitData\User`](./user.md) | ||
- **Default:** `null` | ||
|
||
__Optional._ An object containing data about the current user. | ||
|
||
### `receiver` | ||
|
||
- **Type:** [`TgWebValid\Entities\InitData\Receiver`](./receiver.md) | ||
- **Default:** `null` | ||
|
||
__Optional._ An object containing data about the chat partner of the current user in the chat where the bot was launched via the attachment menu. Returned only for private chats and only for Web Apps launched via the [attachment menu](https://core.telegram.org/bots/webapps#adding-bots-to-the-attachment-menu). | ||
|
||
### `chat` | ||
|
||
- **Type:** [`TgWebValid\Entities\InitData\Chat`](./chat.md) | ||
- **Default:** `null` | ||
|
||
__Optional._ An object containing data about the chat where the bot was launched via the attachment menu. Returned for supergroups, channels and group chats – only for Web Apps launched via the [attachment menu](https://core.telegram.org/bots/webapps#adding-bots-to-the-attachment-menu). | ||
|
||
### `chatType` | ||
|
||
- **Type:** `string` | ||
- **Default:** `null` | ||
|
||
__Optional._ Type of the chat from which the Web App was opened. Can be either `sender` for a private chat with the user opening the link, `private`, `group`, `supergroup`, or `channel`. Returned only for Web Apps launched from direct links. | ||
|
||
### `chatInstance` | ||
|
||
- **Type:** `string` | ||
- **Default:** `null` | ||
|
||
__Optional._ Global identifier, uniquely corresponding to the chat from which the Web App was opened. Returned only for Web Apps launched from a direct link. | ||
|
||
### `startParam` | ||
|
||
- **Type:** `string` | ||
- **Default:** `null` | ||
|
||
The value of the [`startattach`](https://core.telegram.org/bots/webapps#adding-bots-to-the-attachment-menu) parameter, passed via link. Only returned for Web Apps when launched from the [attachment menu](https://core.telegram.org/bots/webapps#adding-bots-to-the-attachment-menu) via link. | ||
|
||
### `canSendAfter` | ||
|
||
- **Type:** `int` | ||
- **Default:** `null` | ||
|
||
__Optional._ Time in seconds, after which a message can be sent via the [answerWebAppQuery](https://core.telegram.org/bots/api#answerwebappquery) method. | ||
|
||
### `authDate` | ||
|
||
- **Type:** [`CarbonInterface`](https://carbon.nesbot.com/docs/) | ||
|
||
A date interface for obtaining the time of opening a form in `Unix` format, and not only that. | ||
|
||
### `hash` | ||
|
||
- **Type:** `string` | ||
|
||
A hash of all passed parameters, with which the validator can check their validity. | ||
|
||
## Methods {#methods} | ||
|
||
### `toArray` | ||
|
||
Returns the entity, including children (if any), as an array. | ||
|
||
[Created on the basis of official documentation](https://core.telegram.org/bots/webapps#webappinitdata) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
title: Chat | ||
icon: message | ||
order: 3 | ||
--- | ||
|
||
This object represents a chat. | ||
|
||
## Properties {#properties} | ||
|
||
### `id` | ||
|
||
- **Type:** `int` | ||
|
||
A unique identifier for this chat. This number can have 32-52 significant bits. Therefore, a 64-bit signed integer or double-precision float type is safe to store this identifier. | ||
|
||
### `type` | ||
|
||
- **Type:** `string` | ||
|
||
Type of chat, can be either `group`, `supergroup` or `channel` | ||
|
||
### `title` | ||
|
||
- **Type:** `string` | ||
|
||
Title of the chat | ||
|
||
### `username` | ||
|
||
- **Type:** `string` | ||
- **Default:** `null` | ||
|
||
__Optional._ Username of the chat | ||
|
||
### `photoUrl` | ||
|
||
- **Type:** `string` | ||
- **За замовчуванням:** `null` | ||
|
||
__Optional._ URL of the chat’s photo. The photo can be in `.jpeg` or `.svg` formats. Only returned for Web Apps launched from the [attachment menu](https://core.telegram.org/bots/webapps#adding-bots-to-the-attachment-menu). | ||
|
||
## Methods {#methods} | ||
|
||
### `toArray` | ||
|
||
Returns the entity, including children (if any), as an array. | ||
|
||
[Created on the basis of official documentation](https://core.telegram.org/bots/webapps#webappchat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: Receiver | ||
icon: paper-plane | ||
order: 2 | ||
--- | ||
|
||
This object contains the user data of the Mini App. | ||
|
||
## Properties {#properties} | ||
|
||
### `id` | ||
|
||
- **Type:** `int` | ||
|
||
The unique identifier of the user or bot. This number can have 32-52 significant bits. Therefore, a 64-bit signed integer or double-precision floating-point type is safe to store this identifier. | ||
|
||
### `isBot` | ||
|
||
- **Type:** `bool` | ||
- **Default:** `null` | ||
|
||
__Optional._ `true`, if this user is a bot. | ||
|
||
### `firstName` | ||
|
||
- **Type:** `string` | ||
|
||
First name of the bot. | ||
|
||
### `lastName` | ||
|
||
- **Type:** `string` | ||
- **Default:** `null` | ||
- __Optional._ Last name of the bot. | ||
|
||
### `username` | ||
|
||
- **Type:** `string` | ||
- **Default:** `null` | ||
- __Optional._ Username of the bot. | ||
|
||
### `isPremium` | ||
|
||
- **Type:** `bool` | ||
- **Default:** `null` | ||
- __Optional._ `true`, if this user is a Telegram Premium user | ||
|
||
### `photoUrl` | ||
|
||
- **Type:** `string` | ||
- **Default:** `null` | ||
|
||
__Optional._ URL of the user’s profile photo. The photo can be in `.jpeg` or `.svg` formats. Only returned for web applications launched from [attachment menu](https://core.telegram.org/bots/webapps#adding-bots-to-the-attachment-menu). | ||
|
||
## Methods {#methods} | ||
|
||
### `toArray` | ||
|
||
Returns the entity, including children (if any), as an array. | ||
|
||
[Created on the basis of official documentation](https://core.telegram.org/bots/webapps#webappuser) |
Oops, something went wrong.