You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@onirix/api-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onirix/api-client

Onirix API library wrapper

1.2.2
latest
npmnpm
Version published
Maintainers
1
Created
Source

Onirix API library wrapper

JavaScript wrapper library for Onirix REST API.

Usage from the browser

Using a bundler (Webpack, Rollup):

  • Install the dependency:
npm install @onirix/api-client
  • Import and use it within your code:
import OnirixAPI from '@onirix/api-client';
        
const OnirixAPIClient = new OnirixAPI("<token>");

OnirixAPIClient.getProjects().then((projects) => {

    ...

});

Using plain HTML

  • Include the dependency within the HTML head tag:
<head>
...
    <script src="https://unpkg.com/@onirix/api-client@1.2.0/dist/ox-api.umd.js">
...
</head>
  • Use it from any other script:
<script>
    const OnirixAPIClient = new OnirixAPI("<token>");
    
    OnirixAPIClient.getProjects().then((projects) => {
    
        ...
    
    });
</script>

Usage from Node.js

As this library uses fetch for http requests, a polyfill (isomorphic-unfetch) is needed when used in a Node environment.

  • Install dependencies:
npm install @onirix/api-client
npm install isomorphic-unfetch
  • Import the dependencies and use the library from your code:
import 'isomorphic-unfetch';

import OnirixAPI from '@onirix/api-client';
        
const OnirixAPIClient = new OnirixAPI("<token>");

OnirixAPIClient.getProjects().then((projects) => {

    ...

});

FAQs

Package last updated on 26 May 2022

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