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

@harnessio/ff-react-client-sdk

Package Overview
Dependencies
Maintainers
8
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harnessio/ff-react-client-sdk - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0-rc1

4

package.json
{
"name": "@harnessio/ff-react-client-sdk",
"version": "1.3.0",
"version": "1.4.0-rc1",
"author": "Harness",

@@ -24,3 +24,3 @@ "license": "Apache-2.0",

"dependencies": {
"@harnessio/ff-javascript-client-sdk": "^1.10.0",
"@harnessio/ff-javascript-client-sdk": "^1.12.0",
"lodash.omit": "^4.5.0"

@@ -27,0 +27,0 @@ },

@@ -12,3 +12,3 @@ # React.js Client SDK For Harness Feature Flags

This sample doesn't include configuration options, for in depth steps and configuring the SDK, see
the [React Client SDK Reference](https://docs.harness.io/article/ptyhvcixyg-react-client-sdk-guide).
the [React Client SDK Reference](https://developer.harness.io/docs/feature-flags/ff-sdks/client-sdks/react-client).

@@ -24,5 +24,5 @@ ## Requirements

- [Created a Feature Flag on the Harness Platform](https://docs.harness.io/article/1j7pdkqh7j-create-a-feature-flag)
- [Created a Feature Flag on the Harness Platform](https://developer.harness.io/docs/feature-flags/ff-creating-flag/create-a-feature-flag/)
called `harnessappdemodarkmode`
- [Created a client SDK key](https://docs.harness.io/article/1j7pdkqh7j-create-a-feature-flag#step_3_create_an_sdk_key)
- [Created a client SDK key](https://developer.harness.io/docs/feature-flags/ff-creating-flag/create-a-feature-flag/)
and made a copy of it

@@ -351,6 +351,30 @@

## Testing with Jest
When running tests with Jest, you may want to mock the SDK to avoid making network requests. You can do this by using
the included `TestWrapper` component. This component accepts a listing of flags and their values, and will mock the SDK
to return those values. In the example below, we use Testing Library to render the component `<MyComponent />` that
internally uses the `useFeatureFlag` hook.
```typescript jsx
import { render, screen } from '@testing-library/react'
import { TestWrapper } from '@harnessio/ff-react-client-sdk/test-utils'
// ...
test('it should render the flag value', () => {
render(
<TestWrapper flags={{ flag1: 'value1', flag2: 'value2' }}>
<MyComponent />
</TestWrapper>
)
expect(screen.getByText('value1')).toBeInTheDocument()
})
```
## Additional Reading
For further examples and config options, see
the [React.js Client SDK Reference](https://docs.harness.io/article/ptyhvcixyg-react-client-sdk-guide)
the [React.js Client SDK Reference](https://developer.harness.io/docs/feature-flags/ff-sdks/client-sdks/react-client)
For more information about Feature Flags, see

@@ -357,0 +381,0 @@ our [Feature Flags documentation](https://docs.harness.io/article/0a2u2ppp8s-getting-started-with-feature-flags).

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