https://github.com/switcherapi/switcher-api
Switcher API is a Feature Flag API focused on toggling features over different environments and applications
https://github.com/switcherapi/switcher-api
feature-flags nodejs switcher switcher-api toggle
Last synced: 8 months ago
JSON representation
Switcher API is a Feature Flag API focused on toggling features over different environments and applications
- Host: GitHub
- URL: https://github.com/switcherapi/switcher-api
- Owner: switcherapi
- License: mit
- Created: 2019-11-18T06:33:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-13T01:37:31.000Z (8 months ago)
- Last Synced: 2025-04-13T02:25:58.247Z (8 months ago)
- Topics: feature-flags, nodejs, switcher, switcher-api, toggle
- Language: JavaScript
- Homepage: https://cloud.switcherapi.com
- Size: 2.01 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
***
Switcher API
Switching fast. Adapt everywhere.
[](https://github.com/switcherapi/switcher-api/actions/workflows/master.yml)
[](https://sonarcloud.io/dashboard?id=switcherapi_switcher-api)
[](https://snyk.io/test/github/switcherapi/switcher-api)
[](https://opensource.org/licenses/MIT)
[](https://hub.docker.com/r/trackerforce/switcher-api)
[](https://switcher-hq.slack.com/)
***

# About
**Switcher API** is a *Feature Manager* that allows you to control your application features using feature flags, also known as feature toggles, feature switches, or feature flippers. It is a cloud-based solution that provides a simple and efficient way to manage your features, enabling you to release new features to your users with confidence.
Main features:
- Easy to setup and seamless integration with your application using our lightweight Client SDKs.
- Distributed Switchers can be used across multiple applications allowing you to control features in a centralized fashion.
- Multi-environment support. Create and manage features across different environments.
- Add extra layer of verification with custom conditions using Strategies.
- Delegate Switcher criteria decision to specialized application with Switcher Relay.
- Support to multiple teams and granular access control.
- Integrate with Slack usign Switcher Slack App to enable approval workflows.
- Integrate with your CI/CD pipeline to automate feature releases and centralize feature management with Switcher GitOps.
- Detailed metrics and logs to help you to track and monitor your features.
* * *
### Local setup
1. npm ci
2. Add .env-cmdrc file into the project directory (use '.env-cmdrc-template')
3. Replace values such as secret keys and URLs
### Running Switcher API from Docker Composer manifest file
This option leverages Switcher API and Switcher Management with minimum settings required.
1. Modify the configuration file "config/.env.dev":
- JWT_SECRET: With your secure private key
- SWITCHERAPI_URL: The Switcher API URL that Switcher Management will use internally
- SM_IP: IP/DNS used by Switcher Management internal redirects
2. Run:
```
docker-compose --env-file ./config/.env.dev up -d
```
3. Open Switcher Management:
```
http://localhost
```
# Quick start
Open Swagger UI by accessing the URL: http://localhost:3000/api-docs
Or use Postman by importing either the OpenAPI json from http://localhost:3000/swagger.json or Postman Collection from "requests/Switcher API*"
## API configuration
### Signing up
Signing up an account to use Switcher API with an email/password or linking it to a GitHub or Bitbucket account.
- **Singing up via email** - Admin: /admin/signup [POST]
- **Singing up via GitHub** - Admin: /admin/github/auth?code= [POST]
- **Singing up via Bitbucket** - Admin: /admin/bitbucket/auth?code= [POST]
- **Access confirmation** - Admin: /admin/signup/authorization?code= [POST]
### Domain
Domains are responsible for centralizing all settings and configurations.
It is equivalent to an organization that can manage multiple projects, users, and environments.
- **New domain** - Domain: /domain/create [POST]
### Component
Components are applications that are using Switcher API.
Each component has its own access token and needs to be linked to Switchers.
- **Create a component** - Component: /component/create [POST]
- **Generating a new API Key** - Component: /component/generateApiKey [GET]
### Group
Groups are used to organize Switchers that share the same feature scope.
- **New Group** - GroupConfig: /groupconfig/create [POST]
### Switcher
Switchers are the main entities to control features.
- **New Switcher** - Config: /config/create [POST]
### Strategy
Customize the behavior of the Switcher by including strategy rules to your Switchers.
- **New Strategy** - ConfigStrategy: /configstrategy/create [POST]
## API usage
In order to use Switcher API, you need to authenticate the component before using it.
See also our SDKs to integrate Switcher API with your application.
- **Auth** - Client API: /criteria/auth [POST]
- **Executing** - Client API: /criteria?key=SWITCHER_KEY [POST]