ethiotelecom-login-util-js
v1.1.12
Published
A utility to log into Ethio Telecom and retrieve user data.
Readme
ethiotelecom-login-util-js
A robust, headless automation utility to validate **Ethio Telecom Web Access ** credentials and securely retrieve the authenticated user’s full display name
Designed for backend services, automation scripts, CI pipelines, and internal tooling.
✨ Features
- 🔐 Secure by Design – Credentials are read from environment variables
- 🟨 JavaScript First – Simple API that works out of the box
- 🟦 TypeScript Support – Fully typed with IDE autocomplete
- ⚡ Minimal API – One async function does everything
- 🛠 Production Ready – Error handling and timeout management
📦 Installation
Requirements: Node.js 16+
npm install ethiotelecom-login-util-js🚀 Usage
1️⃣ Set Environment Variables (Recommended)
| Variable | Description |
| ------------- | ---------------------- |
| ET_USERNAME | Ethio Telecom username |
| ET_PASSWORD | Ethio Telecom password |
2️⃣ JavaScript Example (Recommended)
import { getUserName } from 'ethiotelecom-login-util-js';
const username = process.env.ET_USERNAME;
const password = process.env.ET_PASSWORD;
async function main() {
try {
if (!username || !password) {
throw new Error('ET_USERNAME or ET_PASSWORD is not set');
}
const fullName = await getUserName(username, password);
console.log(`✅ Login Successful: ${fullName}`);
} catch (error) {
console.error('❌ Authentication Failed');
console.error(error.message);
}
}
main();3️⃣ TypeScript Example
import { getUserName } from 'ethiotelecom-login-util-js';
// ⚠️ Read credentials from environment variables
const username: string = process.env.ET_USERNAME ?? '';
const password: string = process.env.ET_PASSWORD ?? '';
async function retrieveUserName(): Promise<void> {
try {
if (!username || !password) {
throw new Error('ET_USERNAME or ET_PASSWORD is not set');
}
const fullName: string = await getUserName(username, password);
console.log('✅ Login Successful!');
console.log(`Authenticated User Name: ${fullName}`);
} catch (error: any) {
console.error('❌ Authentication Failed.');
console.error(error.message);
}
}
retrieveUserName();4️⃣ CommonJS Example
const { getUserName } = require('ethiotelecom-login-util-js');
getUserName(process.env.ET_USERNAME, process.env.ET_PASSWORD)
.then(name => console.log(name))
.catch(err => console.error(err.message));⚠️ Important Notes
- Automation Only – Intended for backend and internal tools
- Credential Safety – Never commit passwords or
.envfiles - Browser Requirement – Runs a headless Chromium instance
🔍 Keywords
ethiotelecom, ethio telecom login, owa login, playwright, headless automation, nodejs automation
📄 License
MIT
👨💻 Author
Yonas 0930327375
