{"id":18676,"library":"postex-auth-sdk-stage","title":"PostEx Auth SDK","description":"PostEx Authentication SDK (v1.4.0) provides a comprehensive solution for implementing secure authentication in web applications. Supports WebAuthn/Passkeys, OTP verification, magic link authentication, and DPoP (RFC 9449 compliant token binding). Features include multi-factor authentication, automatic token management, trusted device recognition, and browser feature detection. Ships TypeScript types. Active development with regular releases. Differentiators: includes DPoP support and passkey-first approach.","status":"active","version":"1.4.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","auth","webauthn","passkey","otp","sdk","postex","typescript"],"install":[{"cmd":"npm install postex-auth-sdk-stage","lang":"bash","label":"npm"},{"cmd":"yarn add postex-auth-sdk-stage","lang":"bash","label":"yarn"},{"cmd":"pnpm add postex-auth-sdk-stage","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only package; CJS require fails. Use import or dynamic import.","wrong":"const AuthSDK = require('postex-auth-sdk-stage')","symbol":"AuthSDK","correct":"import { AuthSDK } from 'postex-auth-sdk-stage'"},{"note":"TypeScript type import only; not a runtime value. Use 'import type' to avoid bundling issues.","wrong":"import { AuthSDKConfig } from 'postex-auth-sdk-stage'","symbol":"AuthSDKConfig","correct":"import type { AuthSDKConfig } from 'postex-auth-sdk-stage'"},{"note":"TypeScript type import only; not a runtime value. Use 'import type' to avoid bundling issues.","wrong":"import { AuthStatusResponse } from 'postex-auth-sdk-stage'","symbol":"AuthStatusResponse","correct":"import type { AuthStatusResponse } from 'postex-auth-sdk-stage'"},{"note":"TypeScript type import only; not a runtime value. Use 'import type' to avoid bundling issues.","wrong":"import { InitiateAuthResponse } from 'postex-auth-sdk-stage'","symbol":"InitiateAuthResponse","correct":"import type { InitiateAuthResponse } from 'postex-auth-sdk-stage'"}],"quickstart":{"code":"import { AuthSDK } from 'postex-auth-sdk-stage';\n\nconst auth = new AuthSDK({\n  apiKey: process.env.API_KEY ?? '',\n  appId: 'postexglobal'\n});\n\nasync function authenticate() {\n  try {\n    const status = await auth.getStatus({ email: 'user@example.com' });\n    const result = await auth.initiateAuth({ email: 'user@example.com' });\n    if (result.status === 'webauthn_challenge') {\n      const authResponse = await auth.authenticateWithPasskey({\n        challenge: result.challenge,\n        rp: result.rp,\n        credentialIds: result.credentialIds\n      });\n      console.log('Passkey authenticated', authResponse);\n    } else if (result.status === 'otp_sent') {\n      const otpResponse = await auth.verifyOTP('123456');\n      console.log('OTP verified', otpResponse);\n    }\n  } catch (error) {\n    console.error('Authentication failed', error);\n  }\n}\n\nauthenticate();","lang":"typescript","description":"Initializes the AuthSDK with environment variables, checks status, initiates authentication, and handles passkey or OTP flows."},"warnings":[{"fix":"Use import syntax or dynamic import().","message":"ESM-only package: CommonJS require() will fail","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use one of the allowed values. Default is 'postexglobal'.","message":"appId parameter only accepts predefined values: 'xstak', 'postex', 'callcourier', 'postexglobal', 'postexsa'. Using an unknown value may cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Provide at least one identifier: email or mobileNumber.","message":"initiateOTP() throws an error if both email and mobileNumber are missing/empty","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use object form: { email: '...' } or { mobileNumber: '...' }.","message":"Passing a plain string to getStatus() or initiateAuth() may be deprecated in future versions","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use 'import type' for all type-only imports.","message":"TypeScript types are exported as types only (not runtime values). Attempting to use them at runtime will throw.","severity":"gotcha","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":"Add \"type\": \"module\" to package.json or use dynamic import().","cause":"ESM-only package used with CommonJS/Node.js without \"type\": \"module\" in package.json","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Use import { AuthSDK } from 'postex-auth-sdk-stage' instead of import AuthSDK from ...","cause":"Wrong import: likely imported as default instead of named","error":"TypeError: auth.getStatus is not a function"},{"fix":"Use one of: 'xstak', 'postex', 'callcourier', 'postexglobal', 'postexsa'","cause":"Passed an invalid appId value","error":"Request failed with status 400: {\"error\":\"Unknown appId\"}"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}