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

headlight-client

Package Overview
Dependencies
Maintainers
3
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

headlight-client

The headlight-client library is an SDK for interacting with [Headlight](http://headlightiq.com/)

  • 3.1.116
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

headlight-client

The headlight-client library is an SDK for interacting with Headlight

It contains the following resources:

HTML API Documentation/docs
Browserify es6 bundle/dist/headlight-bundle
NodeJS Typescript Client/node
AngularJS Typescript Client/angularjs
Angular6 Typescript Client/angular6
Unit tests/node/test

Getting Started

Setup your project for typescript.

Then install this package:

npm install headlight-client

Create an example.ts script file:

import * as Headlight from 'headlight-client';

const _ServerURL = 'https://headlightqa.paviasystems.com';
const _UserName = 'user';
const _Password = 'password123';

async function main()
{
    var client = new Headlight.Client(_ServerURL);
    let session = await client.login(_UserName, _Password);

    let userApi = client.API(Headlight.API.UserApi);
    let record = await userApi.read(client.UserSession.UserID);

    console.log(`My name is ${record.NameFirst} ${record.NameLast}`);
}

main();

Execute your script with:

ts-node example.ts

Using in the browser

Just include the headlight-bundle.min.js file in your html document. You can then reference the client under the "Headlight" namespace.

<html>
  <head>
    <script src="headlight-bundle.min.js"></script>
  </head>
  <body>
    <script type="text/javascript">
        var client = new Headlight.Client("https://headlightqa.paviasystems.com");
        client.login("user", "password123")
            .then((session) => {
                console.log(session);
            });
    </script>
  </body>
</html>

Using as a bower component

bower.json

{
  ...
  "dependencies": {
    "headlight-client": "https://github.com/paviasystems/headlight-client.git"
  },
  "overrides": {
    "headlight-client": {
      "main": [
        "dist/headlight-bundle.min.js"
      ]
    }
}

Keywords

FAQs

Package last updated on 09 Jan 2020

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