Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

configcat-react

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

configcat-react

ConfigCat is a configuration as a service that lets you manage your features and configurations without actually deploying new code.

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-43.85%
Maintainers
1
Weekly downloads
 
Created
Source

ConfigCat SDK for React applications (alpha version)

https://configcat.com

ConfigCat SDK for React provides easy integration for your web application to ConfigCat.

About

Manage features and change your software configuration using ConfigCat feature flags , without the need to re-deploy code. A 10 minute trainable Dashboard allows even non-technical team members to manage features directly. Deploy anytime, release when confident. Target a specific group of users first with new ideas. Supports A/B/n testing and soft launching.

ConfigCat is a hosted feature flag service. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.

Getting Started

ConfigCat React SDK builts on our configcat-js SDK (TODO link here). It uses Context API (requires React 16.3 or later) and Hook API (requires React 16.8 or later) to provide a better integration in your React application.

1. Install package:

via NPM package:

npm i configcat-react

2. Go to the ConfigCat Dashboard to get your SDK Key:

SDK-KEY

3. Import and initialize ConfigCatProvider

In most cases you should wrap your root component with ConfigCatProvider to access ConfigCat features in child components with Context API.

import React from "react";
import { ConfigCatProvider } from "configcat-react";

function App() {
  return (
    <ConfigCatProvider
      client={/* pass your configcat instance */}
    >
      {/* your application code */}
    </ConfigCatProvider>
  );
}

export default App;

4. Get your setting value:

1. Use React hooks - useFeatureFlag, useConfigCatClient

The hooks (useFeatureFlag) way:

function ButtonComponent() {
  const isAwesomeFeatureEnabled = useFeatureFlag(
    "isawesomefeatureenabled",
    false
  );

  return (
    <button
      disabled={!isAwesomeFeatureEnabled}
      onClick={() => alert("ConfigCat <3 React")}
    >
      isAwesomeFeature
    </button>
  );
}

Need help?

https://configcat.com/support

Contributing

Contributions are welcome. For more info please read the Contribution Guideline.

About ConfigCat

Keywords

FAQs

Package last updated on 09 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc