🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@astro-my/featuretoggle

Package Overview
Dependencies
Maintainers
8
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astro-my/featuretoggle - npm Package Compare versions

Comparing version
2.0.0
to
2.0.1
+1
-1
package.json
{
"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",

@@ -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