OVH API wrapper library for TypeScript
!npm version
!npm size
!npm minified size
!git activity
All handlers and models are generated directly from the API specification received from OVH themselves.
This is an unofficial project and not affiliated with OVH!
npm install node-ovh-ts
`$3
`
yarn add node-ovh-ts
`$3
`
pnpm add node-ovh-ts
`Usage
A full list of API routes is available at the OVH API Console. View this projects API documentation to see how it maps the route calls.`ts
class OVH {
constructor(
appKey: string,
appSecret: string,
consumerKey: string,
options?: {
endpoint: 'ovh-eu'
}
)
)
`$3
`ts
import OVH from 'node-ovh-ts';const ovhClient = new OVH(
'',
'',
'',
)
// GET /me
const me = ovhClient.me.get()
`Tree shaking
The default export (even minified) is quite big since it includes all handlers at once. If used for a client-side application you should consider code splitting to only include the handlers relevant to your application. To enable tree shaking, a custom client can be created like so:
`ts
import { OVHBase, MeHandler } from 'node-ovh-ts';class CustomClient extends OVHBase {
me = new MeHandler(this)
}
const ovhClient = new CustomClient(
'',
'',
'',
);
// GET /me
const me = ovhClient.me.get()
`
Known issues
*
/auth for consumer key refetching is currently not implemented
* The API has some generics in it's type definition, these are currently typed as any`