0.12.0 • Published 4 years ago

@chargetrip/javascript-sdk v0.12.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@chargetrip/sdk

@chargetrip/javascript-sdk

Version MIT License

JavaScript SDK for Chargetrip services.

Disclaimer: The package is under active development and the final API is a subject to change.

Installation & usage

Install the package in your project:

yarn add @chargetrip/javascript-sdk

Then import it and initialize:

import { sdk } from '@chargetrip/javascript-sdk';

sdk.init({
  clientId: '<your_client_id>',
});

Target support

@chargetrip/sdk supports:

  • TypeScript - provides type declarations for the JavaScript files
  • Browser - provides pre-built and minified ESM modules for those browsers
  • React Native - provides source code (the build will done in your project)
  • Node - provides pre-built CJS modules for Node 10+

If you need to target different environments or only modern browsers, we recommend to setup compilation of the shipped source code in your project. The source code is available in @chargetrip/sdk/src directory. If you're using using Babel, please make sure the following presets/plugins are included in your Babel config:

  • @babel/preset-typescript
  • @babel/plugin-proposal-class-properties
  • @babel/plugin-proposal-optional-chaining
  • @babel/plugin-proposal-nullish-coalescing-operator

Sponsors

Chargetrip logo