1.2.1 • Published 3 years ago
spice-token-validator v1.2.1
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
- Add this package as a dependency of the webinar backend NestJS project.
- In
app.module.ts
import theSpiceValidatorModule
and add id to the app module imports asSpiceValidatorModule.register()
. - 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]
}
});
- Make the corresponding changes to your
env variables
. - Now you should have a new endpoint in your API 🎉🎉