{"library":"mogh_auth_client","title":"Mogh Auth Client","description":"Mogh Auth Client is a TypeScript library for authenticating with the Mogh authentication service, version 1.3.0. It supports token-based authentication and session management. The package ships with TypeScript types and is intended for use in Node.js or browser environments. It is maintained by the MoghTech team with a focus on security and ease of integration.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install mogh_auth_client"],"cli":null},"imports":["import { MoghAuthClient } from 'mogh_auth_client'","const { MoghAuthClient } = require('mogh_auth_client')","import type { MoghAuthClientOptions } from 'mogh_auth_client'","import { MoghAuthClient } from 'mogh_auth_client'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { MoghAuthClient } from 'mogh_auth_client';\n\nconst client = new MoghAuthClient({\n  apiKey: process.env.MOGH_API_KEY ?? '',\n  endpoint: 'https://auth.mogh.io/v1'\n});\n\nasync function authenticate() {\n  try {\n    const result = await client.authenticate({\n      username: 'user@example.com',\n      password: 'securepassword'\n    });\n    console.log('Access Token:', result.accessToken);\n  } catch (error) {\n    console.error('Auth failed:', error);\n  }\n}\n\nauthenticate();","lang":"typescript","description":"Creates a MoghAuthClient instance and authenticates a user with email and password, then logs the access token.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}