Skip to content

mahtab2003/mofh-client-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MOFH Client (TypeScript)

A TypeScript client for the MyOwnFreeHost (MOFH) API. This library provides a strongly-typed interface for interacting with the MOFH XML and JSON APIs.

Installation

npm install mofh-client-ts

Usage

import { Client } from 'mofh-client-ts';

const client = new Client('your_api_username', 'your_api_password');

// Example: Check domain availability
const availability = await client.availability('example.com');
if (availability.isAvailable()) {
    console.log('Domain is available!');
}

// Example: Create an account
const account = await client.createAccount('user123', 'password', 'email@example.com', 'example.com', 'Plan1');
if (account.isSuccessful()) {
    console.log('Account created:', account.getVpUsername());
} else {
    console.error('Error:', account.getMessage());
}

Features

  • Full TypeScript support with type definitions.
  • Promise-based API using axios.
  • Support for all major MOFH API endpoints:
    • Create/Suspend/Unsuspend/Remove Account
    • Change Password/Package
    • Check Availability
    • Get User Domains/Domain User
    • Support Tickets (Create/Reply)
    • CNAME Verification

License

MIT

About

A TypeScript client for the MyOwnFreeHost (MOFH) API. This library provides a strongly-typed interface for interacting with the MOFH XML and JSON APIs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors