@turnkeyid/configurator-sdk
v1.0.5
Published
Ready to use vault config loader with session
Downloads
1
Readme
Welcome to TurnkeyID Configurator SDK! 💌 👋
Ready to use vault config loader with session
Goal
- Services can have centralized config, but local config still has control over
- Ability to fail-over and prioritize sources : (SESSION(Non-Expired) -> VAULT -> LOCAL -> SESSION)
How to use
- Install this package
npm install --save @turnkeyid/configurator-sdk # or yarn add @turnkeyid/configurator-sdk
- Create your own logger function:
// ./configs/my_service_config.ts export const MyServiceConfigurator = ConfiguratorSDK.create<MyServiceConfig>({ configuratorAppRootDir: process.cwd(), // *required, where root dir of the program lies configMapper: config => config, configName: 'MY_SERVICE_CONFIGURATOR', configPath: 'my_service_config', configuratorSettingOverride: { sessionStorageDir: "sessions", // path / dir relative to configuratorAppRootDir! localRootDir: "local_configs", // path / dir relative to configuratorAppRootDir! }, })
- Import it anywhere:
// ./index.ts import { MyServiceConfigurator } from './configs/my_service_config.ts' // remember you need to wrap await with async function // get all configs const configs = await MyServiceConfigurator.get() // result : MyServiceConfig[] // get by config id const configId1 = await MyServiceConfigurator.getByID(1) // result : MyServiceConfig | undefined
Change Logs
- v1.0.3:
- Fixes:
- Fix
sessionHistory
setting don't work - Fix history files pilled up uncontrollable.
- Fix
- Fixes:
- v1.0.2:
- Introduce README
- BREAKING change,
ConfiguratorSettingsType -> ConfiguratorSetting
- BREAKING change,
configuratorAppRootDir
is required on create configurator! - Ability to save session version history, sessionHistory (default: true)
- Ability to set priority config source VAULT or LOCAL (default: VAULT)
- Performance improvement
- v1.0.1:
- Project initialized
Author
👷♀️ TurnkeyID Developers - Fatihaziz
- Website: turnkey.id
- Github: @turnkey-devs
- Fatih's Github: @fatihaziz
Question
Show your support
Give a ⭐️ if this project helped you!