Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-ovh-ts

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ovh-ts

OVH API wrapper library for TypeScript

  • 0.0.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

TypeScript wrapper for the OVH API

A wrapper class for the OVH API which wraps every route into a strongly typed signature.

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!

Installation

npm

npm install node-ovh-ts

yarn

yarn add node-ovh-ts

pnpm

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.

class OVH {
  constructor(
    appKey: string,
    appSecret: string,
    consumerKey: string,
    options?: {
      endpoint: 'ovh-eu'
    }
  )
)

Example

import OVH from 'node-ovh-ts';

const ovhClient = new OVH(
  '<appKey>',
  '<appSecret>',
  '<consumerKey>',
)

// 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:

import { OVHBase, MeHandler } from 'node-ovh-ts';

class CustomClient extends OVHBase {
  me = new MeHandler(this)
}

const ovhClient = new CustomClient(
  '<appKey>',
  '<appSecret>',
  '<consumerKey>',
);

// 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

Keywords

FAQs

Package last updated on 12 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc