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

lightrail-client

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightrail-client

A Javascript and Typescript client for Lightrail

  • 4.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27
decreased by-6.9%
Maintainers
4
Weekly downloads
 
Created
Source

Lightrail Client for JavaScript and TypeScript

Lightrail is a modern platform for digital account credits, gift cards, promotions, and points (to learn more, visit Lightrail). This is a basic library for developers to easily connect with the Lightrail API using Javascript or Typescript.

Features

The following features are supported in this version:

Contacts

Create, Get, List, Update, Delete, List Values, Attach Value

Values

Create, Get by Id, Get by FullCode, List, Update, Delete

Programs

Create, Get, List, Update, Delete, Create Issuance, Get Issuance, List Issuances

Transactions

Checkout, Debit, Credit, Transfer, Reverse, Capture Pending, Void Pending, Get, List

Currencies

Create, Get, List, Update, Delete

Note that the Lightrail API supports many other features and we are still working on covering them in this library. For a complete list of Lightrail API features check out the Lightrail API documentation.

Usage

Configuration

Before using this client, you'll need to configure it to use your API key:

const Lightrail = require('lightrail');

Lightrail.configure({
  apiKey: '<LIGHTRAIL API KEY>'
})

Compiling for node with webpack

This library uses superagent to facilitate network requests. To have webpack use the node-version of superagent your webpack config must include target: 'node'.

If when running your code you see the error TypeError: undefined is not a function then most likely you must include the following in the plugins section of your webpack config: plugins: [new webpack.DefinePlugin({"global.GENTLY": false})]. See https://github.com/felixge/node-formidable/issues/337 for an explanation.

Development

Testing

Testing requires a Lightrail account. Copy .env.example to .env and set your account's test API key which is available in the Lightrail web app.

Then you can run npm test.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Giftbit/lightrail-client-javascript.

Releasing (Lightrail team only)

  1. Update the version of the project in package.json following semantic versioning.
  2. Publish to npm with the command npm publish. Tests and linting run as part of this script.
  3. Create a GitHub release. The release name and tag must be v followed by the version number (eg: v1.2.3). The description must list changes and highlight any breaking changes.

License

This library is available as open source under the terms of the MIT License.

Keywords

FAQs

Package last updated on 19 Nov 2019

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