@astro-my/featuretoggle
Advanced tools
+1
-1
| { | ||
| "name": "@astro-my/featuretoggle", | ||
| "version": "2.0.0", | ||
| "version": "2.0.1", | ||
| "description": "Retrieve feature flags status for services or portal", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
+35
-2
@@ -1,2 +0,35 @@ | ||
| # featureToggle | ||
| Retrieve feature flags for service or portal | ||
| # Feature Flag SDK | ||
| A client-side Javascript SDK that handles communication with **Feature Flag** service | ||
| ## How it works | ||
| The SDK will make an API call to the service which will retrieve the information from cache before resorting to calling the DB | ||
| ## Getting Started | ||
| 1. Calling the `get` method with featureId (which can be found on the feature store in admin portal) will return information for the particular flag | ||
| ```javascript | ||
| const ICode = require('@astro-my/idc-code') | ||
| const featureflag = require('@astro-my/featuretoggle') | ||
| exports.get = async (req, res, next) => { | ||
| try { | ||
| const { featureId } = req.query | ||
| const result = await featureflag.get(featureId) | ||
| return res.status(ICode.HTTP.OK).json({ | ||
| responseCode: ICode.HTTP.OK, | ||
| responseMessage: 'Flag successfully fetched', | ||
| response: result | ||
| }) | ||
| } catch (err) { | ||
| return next(err) | ||
| } | ||
| } | ||
| ``` | ||
| ## Features | ||
| - Retrieves feature flag information |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
11842
7.98%36
1100%