@orangewall/motive-rest-api
v0.1.0
Published
Utility library for managing Motive API authentication with DynamoDB integration
Downloads
19
Maintainers
Readme
motive-rest-api
A utility library for managing Motive API authentication with DynamoDB integration. This package provides functions to refresh Motive OAuth tokens.
Features
- Token Management: Automatically refresh Motive OAuth tokens using stored refresh tokens
Configuration
Before using this library, you need to configure your project with the required Motive API settings.
Get Started
- Run
npm installin your terminal - Then run
npm run build - Update the
package.jsonwith the new version that needs to be published - Create an account with npm if you don't have one already. Also be sure to enable two-factor authentication
- Sign in to your npm account in your terminal with
npm login - Run
npm publish --access=publicto publish your package
Testing
- Install developer dependencies using the following command in your terminal
npm i -D mocha @types/mocha chai @types/chai ts-node - Create a new file
.mocharc.jsonin the root directory with the following contents:{ "extension": ["ts"], "spec": "./**/*.spec.ts", "require": "ts-node/register" } - Create a
testsfolder - Create an
index.spec.tsfile in thetestsfolder - Write unit tests in the
index.spec.tsfile to test the code inindex.ts - Add a
"test"property in thepackage.jsonfile and give it a value of"mocha" - Run
npm testin your terminal from the root folder of the project
References
https://snyk.io/blog/best-practices-create-modern-npm-package https://github.com/snyk-snippets/modern-npm-package https://github.com/goldbergyoni/javascript-testing-best-practices
