@hosterai/js-client
v1.0.17
Published
Hoster.AI javascript client
Downloads
19
Readme
Hoster.AI JavaScript Client
This is the JavaScript client for Hoster.AI. It provides an easy-to-use interface for interacting with the Hoster.AI API.
Installation
To install the client, use npm:
npm install @hosterai/js-client
Usage
First, import the client:
import { Client } from '@hosterai/js-client';
Then, create a new instance of the client:
const client = new Client('https://api.hoster.ai');
If you're running in a development environment, you can omit the URL and the client will default to http://localhost:3000
.
To authenticate, use the setAccessToken
method:
client.setAccessToken('your access token');
Then, you can use the client to interact with the API. For example, to get a list of addons:
const addons = await client.addons().list();
API
The client provides methods for interacting with all parts of the Hoster.AI API, including:
- Addons
- Affiliates
- Companies
- Coupons
- Domain Categories
- Domain Contacts
- Domain Names
- IP Groups
- IPs
- Integrations
- Invoice Contacts
- Invoices
- Issues
- Items
- Orders
- Payments
- Policies
- Product Categories
- Products
- Settings
- Templates
- TLDs
- Users
Each of these categories has its own set of methods for interacting with the API.