UrielCh / api-ovh-node

a TypeScript helper to use OVH API
MIT License
15 stars 5 forks source link

Use Ovh's Apis with TypeScript

Main core api

All modules packages

Packages for API ovh in Europe

Packages for API ovh in Canada

Packages for API ovh in USA

Packages for API so you start in Europe

Packages for API so you start in Canada

Packages for API kimsufi in Europe

Packages for API kimsufi in Canada

Samples

Find all samples here

Interactive mode with no Credential

Print account information of your OVH-account

import ApiMe from '@ovh-api/me';
import Ovh from '@ovh-api/api';

const ovh = new Ovh({accessRules: 'GET /ip'});
const api = ApiMe(ovh);
api.$get().then(console.log)

You will be asked to authorized an new issued certificat.

Same thing With credential with a certificate

Create your first application tokens here: here

import ApiMe from '@ovh-api/me';
import Ovh from '@ovh-api/api';

const config = {
    appKey: String(process.env.APP_KEY),
    appSecret: String(process.env.APP_SECRET),
    consumerKey: String(process.env.CONSUMER_KEY)
};
const ovh = new Ovh(config);
const api = ApiMe(ovh);
api.$get().then(console.log);

For samples see samples