open-index/open-npm huggingface dataset:
npm package: @punhlainghospitals/auth-backend
Description: Auth backend utilities package for Pun Hlaing Hospitals
Author: Aung Min Oo
Latest version: 0.0.9

## @punhlainghospitals/auth-backend

TypeScript helpers for talking to the Pun Hlaing Hospitals auth backend.

### Install

```bash
npm install @punhlainghospitals/auth-backend
```

This library ships ES module, CommonJS, and TypeScript type definitions.

### Configuration

By default all calls go to:

- `AUTH_SERVER_API`: `https://phhplatform.punhlainghospitals.com/api/auth`

If you need a different auth API URL, configure it at build time (for example by replacing `LibEnv.AUTH_SERVER_API` in your bundler).

### Exports

From `src/index.ts` the package re‑exports:

- `getCurrentUser(accessToken: string): Promise<UserInterface | null>`
- `validateAccessToken(accessToken: string): Promise<AxiosResponse<AccessTokenValidationInterface>>`
- `loginWithOtt(token: string): Promise<AxiosResponse<TokenIssueInterface>>`
- `refreshToken(refreshToken: string): Promise<AxiosResponse<TokenIssueInterface>>`
- `AuthProviderEnum`
- `UserInterface`
- `TokenIssueInterface`
- `AccessTokenValidationInterface`

### Basic usage

```ts
import {
  getCurrentUser,
  validateAccessToken,
  loginWithOtt,
  refreshToken,
  AuthProviderEnum,
  type UserInterface,
} from '@punhlainghospitals/auth-backend';

// Get the current user profile
const user: UserInterface | null = await getCurrentUser('<access-token>');

// Validate an access token
const validation = await validateAccessToken('<access-token>');
if (validation.data.success) {
  console.log('Token is valid for user', validation.data.userId);
}

// Login with one‑time token
const loginResult = await loginWithOtt('<ott-token>');
console.log('Logged in as', loginResult.data.user.name);

// Refresh access token
const refreshed = await refreshToken('<refresh-token>');
console.log('New access token', refreshed.data.accessToken);
```

### Types and enums

You can use the exported interfaces and enum for strong typing:

- `UserInterface`
- `TokenIssueInterface`
- `AccessTokenValidationInterface`
- `AuthProviderEnum` (`'google' | 'local'`)
npm package: @punhlainghospitals/auth-frontend
Description: Auth UI utilities package for Pun Hlaing Hospitals
Author: Aung Min Oo
Latest version: 0.1.12

## auth-ui npm package

This repository now contains a small TypeScript npm package intended for auth-related UI utilities.

### Install

```bash
npm install auth-ui
```

### Usage

```ts
import { createAuthUi } from 'auth-ui';

const description = createAuthUi({ baseUrl: 'https://api.example.com/auth' });
console.log(description);
```

Extend `src/index.ts` with your real auth UI logic and exports.