Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
/ rebilly-js-sdk Public archive

Official Rebilly API JS library for the browser and Node

License

Notifications You must be signed in to change notification settings

Rebilly/rebilly-js-sdk

Repository files navigation

Note This project is still active, however this repository is archived and the source is moved into a private repository. The unmangled source code is still available publically and published as part of the npm package contents.

Rebilly JS SDK library

The Rebilly JS SDK library allows you to consume the Rebilly API using either Node or the browser.

npm GitHub release Try rebilly-js-sdk on RunKit

PCI Compliance note

If you need to handle raw payment card data, you should use Rebilly FramePay to generate tokens for your server-side logic.

Rebilly API definition

This library is a semantic representation of the Rebilly API definition.

The definition includes SDK examples for each API operation, listed under Request samples.

Usage

Instructions for installing and using the JS SDK can be found in the Rebilly Docs

Releasing

This project is released by creating a GitHub release.

To create a release:

  • Go to the Releases page.
  • Click "Draft a new release".
  • Click "Choose a tag" and enter the new version number in the format: vX.X.X.
    • Ensure that your new tag is following semver.
  • After you have typed your new version tag, you should see "Create new tag: vX.X.X on publish" appear in the dropdown, click this.
  • Leave target set to main.
  • Enter the release title in the format: vX.X.X: Summary.
  • In the summary, include a description of the changes since the previous release. This can be generated by clicking "Auto-generate release notes".
  • Click "Publish release" to publish the release.

This process will:

  • Trigger a new workflow run.
  • Bump the package.json version to your new version, and commit that to main.
  • Build and publish the package to npm.

Development

Build development dist folder without sourcemap

npm run build:dev

Build release dist folder with sourcemap (release)

npm run build:prod

Run all unit tests

npm run unit

Watch unit tests and re-run on change

npm run unit:watch

Generate coverage report

npm run coverage

Check that the generated typescript type file is valid (note: you should build the types first, by using either npm run ts:bundle-types-from-redocly or ts:bundle-types-from-local)

npm run test:check-build-types

Typescript types generation

Types are automatically created because npm run ts:bundle-types-from-redocly is called as part of npm run build:prod.

But if you want to test TS types before the related api-definitions have been merged into main, you can run:

    npm run ts:bundle-types-from-local

which will build your local api-definitions branch to generate new TS types that can be tested in your local consumer apps.