Telegram-Mini-Apps / telegram-apps

Made from scratch TypeScript packages, examples and documentation you will surely need to start developing on Telegram Mini Apps.
https://docs.telegram-mini-apps.com/
MIT License
400 stars 79 forks source link

[Feature]: BiometricManager from Bot API 7.2 #286

Closed kewldan closed 2 months ago

kewldan commented 2 months ago

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

Add BiometricManager implementation

Describe alternatives you've considered

No response

Additional context

https://core.telegram.org/bots/webapps#biometricmanager

heyqbnk commented 2 months ago

Will be implemented in @tma.js/sdk3.0 in the next 1-2 weeks

heyqbnk commented 2 months ago

Got confused a bit with versioning. Just released a new major version, its 2.0, but have no docs at the moment. Nevertheless, you can use the JSDoc.

Example:

import { initBiometryManager } from '@tma.js/sdk';

const bm = await initBiometryManager();

if (!bm.available) {
  // Biometry is not available on the device.
  return;
}

// Do something else with the BiometryManager.
heyqbnk commented 1 month ago

Docs: https://docs.telegram-mini-apps.com/packages/tma-js-sdk/components/biometry-manager