1.2.1 • Published 3 years ago

spice-token-validator v1.2.1

Weekly downloads
11
License
MIT
Repository
-
Last release
3 years ago

About

This package is intended as an extension for the webinar backend. It's only function is to provide the necessary mechanism to validate SPICE Tokens generated by IQOS. It should be relatively easy to setup on any given project.

Installation

  1. Add this package as a dependency of the webinar backend NestJS project.
  2. In app.module.ts import the SpiceValidatorModule and add id to the app module imports as SpiceValidatorModule.register().
  3. In config.js add the following:
const ENV_VARS = {
  [...],
  SPICE: {
    URL: 'SPICE_API_CHECK_TOKEN_URL',
    TOKEN: 'SPICE_API_AUTH_TOKEN',
  },
}

interface Config {
  [...],
  spice: SpiceConfig;
}

const createConfig = (): Config => ({
  [...],
  spice: {
    spiceApiAuthToken: process.env[ENV_VARS.SPICE.TOKEN],
    spiceApiCheckTokenUrl: process.env[ENV_VARS.SPICE.URL]
  }
});
  1. Make the corresponding changes to your env variables.
  2. Now you should have a new endpoint in your API 🎉🎉
1.2.0

3 years ago

1.2.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago