{"_id":"4nm","_rev":"3-69014f8da2ccc19c0bfdce908cb049aa","name":"4nm","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.2":{"name":"4nm","version":"0.0.2","main":"dist/index.js","types":"dist/index.d.ts","keywords":["telegram","telegram-web-apps","twa"],"scripts":{"g":"git add . && git commit -m 0 && git push -u origin main -f","test":"tsc --noEmit","build":"tsc","commit":"cz","prerelease":"yarn test && yarn build","release":"standard-version -a","postrelease":"git push --follow-tags origin main & yarn publish --non-interactive"},"devDependencies":{"commitizen":"^4.2.5","cz-conventional-changelog":"3.3.0","npm-run-all":"^4.1.5","standard-version":"^9.5.0","typescript":"^4.8.3"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"734f1fc1211eb8648dc4f79ad2bd69c70c7cd9bd","description":"TypeScript reimplementation of Telegram's official library for communicating  with Telegram Web Apps.","_id":"4nm@0.0.2","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-DLZNiBOEXBnd2zKurvaAyQNpDzAK8dKc5APLQH2TdtXwpaXDNXTI2pmscG501SQJxQKSJEhdXPxNW10cMWUGPw==","shasum":"7a9467e8e4a0bb14527ba3d7006798cb15c7461d","tarball":"https://registry.npmjs.org/4nm/-/4nm-0.0.2.tgz","fileCount":53,"unpackedSize":75254,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE9P3/J2/q5zx0BS8eTh+9Az+EOZwUuHcchnRX8eTM1eAiA74ivmSErP+egD0LBO6UaL93QL9WoLrgBu5dW7cCYMSw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMprwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLJBAAiFPkCatCvZf577Lz7MvOg+7mhhl7jwrwjM4FSFVW5J8wMoFf\r\n6os1LizmntxmaobdyPLa2ohzz/I6vXsKMgSslFDezeo4YEzskDV9yW/73Ymh\r\nDYKOlBKmI4dFS6DRuAxXe1sglvQxcfEc/vRp1eyO/VudXYEJ5DTtEn6Mc5ji\r\njQ5S0Sg15pb9PVWmblvSVBb9vL3aA41jroPuWtroCNjuQBZyLjo7dHBjoO4G\r\n8KIF9WGOoaZvZN6nrJHI9WAFGX7AHRqrsJecwlUEUpZ0C8KyuYt6J75weKLb\r\n1/qwAHFQOyVOi267OoTf9vC/EVvnVU5Dps80cNqZJ01jppPCGEX9r0uGnzcp\r\nk5tVo/xpg1UtN0Z0et4gSkjCpQQgbMXWlnCT7gwSqZkHBPhFw4nKPSIOUCbz\r\nezVLmvSlVLg0WP87aUjLd5+PLItLRjn7153FCqDgMLDvgOGQyYorKAb/tp6W\r\naHf4TC2RVlKRN3Tg0IJimNV75cG/tS3z/Nk32X51evOUGr1dlnUb0Q9MfAMo\r\n2S2kuf2z1Kv4om8y29MNGFp8WWNPg1fgIa1YQA4zN2pTFWa8uPTS3aN8ZTjZ\r\nkLEUgjgfPAWb8pQw91J9/P7X9snGGXVqAh2hZge0PSMuaV/JzxVJi3ti6eAh\r\n5U7xFAMAgbWoOFaMsUlZ+dirTEtolYOduq4=\r\n=4WMX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vsamaru","email":"vsamaru@gmail.com"},"directories":{},"maintainers":[{"name":"vsamaru","email":"vsamaru@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/4nm_0.0.2_1664260848551_0.9496019764810664"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-27T06:40:48.551Z","0.0.2":"2022-09-27T06:40:48.760Z","modified":"2023-02-20T18:36:17.383Z"},"maintainers":[{"email":"dad2vad@gmail.com","name":"dad22"},{"email":"zbndmt@gmail.com","name":"zbndm"},{"email":"vsamaru@gmail.com","name":"o6"}],"description":"TypeScript reimplementation of Telegram's official library for communicating  with Telegram Web Apps.","keywords":["telegram","telegram-web-apps","twa"],"readme":"# Telegram Web Apps Client SDK\n\nTypeScript reimplementation of Telegram's official library for communicating \nwith Telegram Web Apps.\n\n> ⚠️ This library is not the same library created by Telegram developers\n> but with types. It contains similar code, but differs a bit in some moments.\n> Please, refer to documentation in code to avoid problems.\n\n## Motivation\n- Currently, official implementation supports usage only through global\n  `window` object that is not modern and not that comfortable as importing\n  this library as npm package. Nevertheless, it does not mean, this use case\n  should not exist. Some applications may not support modern way of\n  using packages and as a result, the only one possible solution for them is\n  usage through `window` object;\n- Library is written in JavaScript without usage of JSDoc. Modern libraries\n  are now developed with TypeScript which allows developers to know the\n  types they are currently working with;\n- Library contains almost no comments. So, most of the time, it is harder\n  to understand current code flow;\n\n## Installation\n### npm\n```bash\nnpm i twa-client-sdk\n```\n\n### yarn\n```bash\nyarn add twa-client-sdk\n```\n\n## Usage\n\nLibrary contains 2 global components which are commonly used in Web Apps.\nThey are `webView` and `webApp`. These variables are instances of\n`WebView` and `WebApp` which are created by library itself. In case, there is\nsome specific application algorithm, its is allowed to create these instance by \nyourself and initialise, but we recommend using variables which are stored in \nlibrary. \n\nOne of the main important parts of SDK lifecycle is its initialization.\nAs long as `webView` and `webApp` initially have default values, you have\nto fill them with usage of current environment (internally, init scripts read \ndata from global `window` object). \n\nFor this purpose, usage of function `init` is required:\n\n```typescript\nimport {init} from 'twa-client-sdk';\n\n// Initialise library.\ninit();\n\n// Now, we can safely use variables `webView` and `webApp`.\n```\n\"# eex\" \r\n","readmeFilename":"README.md"}