Telegram
[Medusa v2](https://github.com/medusajs/medusa) plugin that provides Telegram integration.
Medusa Telegram
Medusa v2 plugin that provides Telegram integration.
Installation
Add the plugin to your project
Add your telegram bot token to file
Add auth provider in
Built-in Medusa auth routes usage example
TMA auth provider verifies that init data is not tampered or malformed. To receive auth identity you need to pass stringified in the body of the request, e.g.:
Note that should be installed separately
Workflow usage example
However, the idea behind TMA assumes that user doesn't not need neither to login nor to register since Telegram account already acts as an identity. So, this package provides that:
- creates auth identity from init data if it doesn't exist;
- creates customer and links it to the identity if it doesn't exist;
- generates Medusa JWT token for existing or newly created customer.
You'll need a custom route to run this workflow, for example:
Note that should match with provider id registered in
workflow returns Medusa JWT token for the customer. You can use it for subsequent API calls from your storefront.
Roadmap
- TMA auth provider
- Telegram OAuth2 provider
- Telegram notifications provider

