{"id":18893,"library":"uit-metro-universal-auth-library","title":"UIT Metro Universal Auth Library","description":"A corporate authentication library (v1.1.17) for Metro (METRO/MAKRO) loyalty card applications. It provides a pre-built UI flow for phone number entry, SMS code verification, card selection, registration, and manual card linking. The library requires a recaptcha v3 key and an authorization token. It is proprietary (Russian-language docs only) and intended solely for internal Metro use. No release cadence documented; single-version package with limited community adoption. Differentiators: bundled CSS and callbacks for each step, but dependency on Metro-specific APIs and lack of ESM/TypeScript support (no typings) make it unsuitable for general use.","status":"active","version":"1.1.17","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install uit-metro-universal-auth-library","lang":"bash","label":"npm"},{"cmd":"yarn add uit-metro-universal-auth-library","lang":"bash","label":"yarn"},{"cmd":"pnpm add uit-metro-universal-auth-library","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for reCAPTCHA v3 verification; passed as recaptchaKey in initParams.","package":"google-recaptcha-v3","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require() will fail in Node <22 and bundlers that don't handle ESM.","wrong":"const { AuthInit } = require('uit-metro-universal-auth-library');","symbol":"AuthInit","correct":"import { AuthInit } from 'uit-metro-universal-auth-library';"},{"note":"CSS must be imported as a side effect, not a named export.","wrong":"import { styles } from 'uit-metro-universal-auth-library';","symbol":"styles","correct":"import 'uit-metro-universal-auth-library/dist/styles/main.css';"},{"note":"Both default and named imports work, but the named export is the documented way.","wrong":"import { AuthInit } from 'uit-metro-universal-auth-library';","symbol":"AuthInit (default import)","correct":"import AuthInit from 'uit-metro-universal-auth-library';"}],"quickstart":{"code":"import { AuthInit } from 'uit-metro-universal-auth-library';\nimport 'uit-metro-universal-auth-library/dist/styles/main.css';\n\nconst initParams = {\n  env: 'development',\n  authorizationKey: process.env.AUTH_KEY ?? '',\n  recaptchaKey: process.env.RECAPTCHA_KEY ?? '',\n  texts: {\n    registrationFormTitle: 'Зарегистрироваться'\n  },\n  callbacks: {\n    authModalOpened: () => console.log('Modal opened'),\n    smsCodeSended: (request, response) => console.log('SMS sent', response),\n    registrationCompleted: (request, response, formState) => {\n      console.log('Registration completed', formState);\n    }\n  }\n};\n\nconst auth = new AuthInit(initParams);\nauth.init(); // start authentication flow","lang":"typescript","description":"Initialize the authentication library with required environment, authorization key, and optional texts/callbacks."},"warnings":[{"fix":"Ensure you have access to the private npm registry and are logged in with correct credentials.","message":"Package is not available on npm publicly (scoped or private registry required).","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Override texts via the initParams.texts object; for other languages, you must provide translations.","message":"All strings and labels are in Russian; no i18n support provided.","severity":"gotcha","affected_versions":"*"},{"fix":"Explicitly set all text fields in initParams to avoid unexpected UI changes.","message":"The default text values may change between minor versions without notice.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install uit-metro-universal-auth-library` and ensure your project uses ESM (e.g., `\"type\": \"module\"` in package.json).","cause":"Package not installed or missing from node_modules; also may be due to ESM-only resolution.","error":"ERR_MODULE_NOT_FOUND: Cannot find package 'uit-metro-universal-auth-library' imported from ..."},{"fix":"Use `import { AuthInit } from 'uit-metro-universal-auth-library';` instead of `import AuthInit from ...`.","cause":"Wrong import style: default import attempted but package exports named export.","error":"TypeError: AuthInit is not a constructor"},{"fix":"Use `import 'uit-metro-universal-auth-library/dist/styles/main.css';` — no named import.","cause":"CSS file path is incorrect or missing side-effect import.","error":"Module not found: Can't resolve 'uit-metro-universal-auth-library/dist/styles/main.css'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}