open-index/open-npm huggingface dataset:
npm package: @spotify-confidence/client-http
Description: ![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)
Latest version: 0.1.6

# Confidence HTTP Client

![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)

This is a client for direct access to the Confidence API, it is not intended for end user use, it is an internal package
used in `@spotify-confidence/openfeature-web-provider` and `@spotify-confidence/openfeature-server-provider` packages.
npm package: @spotify-confidence/openfeature-server-provider
Description: ![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)
Latest version: 0.3.12

# OpenFeature Server SDK JavaScript Confidence Provider

![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)

JavaScript implementation of the Confidence OpenFeature server provider, to be used in conjunction with the OpenFeature Server SDK.
This implements the dynamic paradigm of OpenFeature.

# Usage

## Adding the dependencies

To add the packages to your dependencies run:

```sh
yarn add @openfeature/server-sdk @openfeature/core @spotify-confidence/sdk @spotify-confidence/openfeature-server-provider
```

## Enabling the provider, setting the evaluation context and resolving flags

```ts
import { createConfidenceServerProvider } from '@spotify-confidence/openfeature-server-provider';
import { OpenFeature } from '@openfeature/server-sdk';

const provider = createConfidenceServerProvider({
  clientSecret: 'your-client-secret',
  fetchImplementation: fetch,
  timeout: 1000,
});

OpenFeature.setProvider(provider);

const client = OpenFeature.getClient();

client
  .getBooleanValue('flagName.bool', false, {
    targetingKey: `your targeting key`,
  })
  .then(result => {
    console.log('result:', result);
  });
```

## Region

The region option is used to set the region for the network request to the Confidence backend. When the region is not set, the default (global) region will be used.
The current regions are: `eu` and `us`, the region can be set as follows:

```ts
const provider = createConfidenceServerProvider({
  region: 'eu', // or 'us'
  // ... other options
});
```

## Timeout

The timeout option is used to set the timeout for the network request to the Confidence backend. When the timeout is reached, default values will be returned.

## Configuring Apply

See [apply concept](../../concepts/apply.md).

Backend apply is the only supported method in the `ConfidenceServerProvider`.
npm package: @spotify-confidence/openfeature-web-provider
Description: ![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)
Latest version: 0.3.12

# OpenFeature Web SDK JavaScript Confidence Provider

![](https://img.shields.io/badge/lifecycle-beta-a0c3d2.svg)

JavaScript implementation of the Confidence OpenFeature web provider, to be used in conjunction with the OpenFeature Web SDK.
This implements the static paradigm of OpenFeature.

# Usage

## Adding the dependencies

To add the packages to your dependencies run:

```sh
yarn add @openfeature/web-sdk @spotify-confidence/openfeature-web-provider
```

## Enabling the provider, setting the evaluation context and resolving flags

`setProvider` makes the Provider launch a network request to initialize the flags. In cases of success the
`ProviderEvents.Ready` event will be emitted. In cases of failure of the network request, the `ProviderEvent.Error`
event will be emitted. The ProviderEvents events will be emitted only when we are done with the network request, either
a successful or a failed network response. If the network response failed, default values will be returned on flag
evaluation, if the network request is successful we update the flags and then emit `ProviderEvents.Ready`.

```ts
import { createConfidenceWebProvider } from '@spotify-confidence/openfeature-web-provider';
import { OpenFeature } from '@openfeature/web-sdk';

const provider = createConfidenceWebProvider({
  clientSecret: 'mysecret',
  fetchImplementation: window.fetch.bind(window),
  timeout: 1000,
});

OpenFeature.setContext({
  targetingKey: 'myTargetingKey',
});

try {
  await OpenFeature.setProviderAndWait(provider);
} (error) {
  console.error('Failed to initialize Confidence provider:', error);
}

const client = OpenFeature.getClient();
const result = client.getBooleanValue('flagName.my-boolean', false);
```

Notes:

- In the above example we first set the context and then set the provider and await for the provider to become ready before getting the flag value. Other ways of arranging these calls might make more sense depending on what app framework you are using. See the example apps for more inspiration.

## Region

The region option is used to set the region for the network request to the Confidence backend. When the region is not set, the default (global) region will be used.
The current regions are: `eu` and `us`, the region can be set as follows:

```ts
const provider = createConfidenceWebProvider({
  region: 'eu', // or 'us'
  // ... other options
});
```

## Timeout

The timeout option is used to set the timeout for the network request to the Confidence backend. When the timeout is reached, default values will be returned.

## Configuring Apply

See [apply concept](../../concepts/apply.md).

By default, `'access'` apply is used, using a timeout of 250ms.

To use Backend Apply, set the apply option to `'backend'`:

```ts
const provider = createConfidenceWebProvider({
    ...,
    apply: 'backend'
});

```
npm package: @spotify/create-web-scripts-library
Description: Project scaffolding script for @spotify/web-scripts libraries
Author: Paul Marbach
Latest version: 15.0.0

# `create-web-scripts-library`

Scaffold a [@spotify/web-scripts](https://github.com/spotify/web-scripts) library quickly. Code was directly inspired by [create-next-app](https://github.com/zeit/create-next-app).

## Usage

### With `yarn create`

```sh
yarn create @spotify/web-scripts-library my-cool-library
```

### With `npx`

```sh
npx @spotify/create-web-scripts-library my-cool-library
```

### Programatically

```javascript
const path = require('path');
const createWebScriptsLibrary = require('@spotify/create-web-scripts-library');

async function start() {
  await createWebScriptsLibrary(path.resolve('my-cool-library'));
}
```
npm package: @spotify/eslint-config
Description: Combined ESLint config for Spotify
Author: Paul Marbach
Latest version: 15.0.0

# @spotify/eslint-config

Spotify's TypeScript full ESLint config.

## Installation

```sh
npm install --save-dev eslint @spotify/eslint-config
```

## Usage

After installing, update your project's ESLint config:

```js
{
  "extends" : ["@spotify"]
}
```

---

Read the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information.
npm package: @spotify/eslint-config-base
Description: Spotify's base ESLint config
Latest version: 15.0.0

# @spotify/eslint-config-base

Spotify's base ESLint config.

## Installation

```sh
yarn add --dev @spotify/eslint-config-base eslint
```

## Usage

After installing, update your project's `.eslintrc.json` file to import the rule sets you want:

```js
{
  "extends" : [
    "@spotify/eslint-config-base"
  ]
}
```

### ES5 only

```js
{
  "extends" : [
    "@spotify/eslint-config-base/es5"
  ]
}
```

### ES6+ only

```js
{
  "extends" : [
    "@spotify/eslint-config-base/es6"
  ]
}
```

---

Read the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information.
npm package: @spotify/eslint-config-oss
Description: ESLint config for use in Spotify's open source JS/TS projects
Author: Paul Marbach
Latest version: 1.0.2

# @spotify/eslint-config-oss

[![Actions Status](https://github.com/spotify/eslint-config-oss/workflows/Tests/badge.svg)](https://github.com/spotify/eslint-config-oss/actions)
[![Version](https://img.shields.io/npm/v/@spotify/eslint-config-oss.svg)](https://www.npmjs.com/package/@spotify/eslint-config-oss)

A simple ESLint config which, when extended onto your ESLint config, will show alerts when required license headers are missing from your source files in Spotify open source projects.

## Usage

```js
module.exports = {
  extends: ['@spotify', '@spotify/eslint-config-oss'],
};
```

## Contributing

This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to honor this code.

Publish should occur on merge using [web-scripts] and [semantic-release]. Please use conventional commits to signal what the new version should be.

[code-of-conduct]: https://github.com/spotify/code-of-conduct/blob/master/code-of-conduct.md
[web-scripts]: https://github.com/spotify/web-scripts
[semantic-release]: https://github.com/semantic-release/semantic-release
npm package: @spotify/eslint-config-react
Description: Spotify's ESLint config for React projects
Latest version: 15.0.0

# eslint-config-react

Spotify's ESLint config for react.

## Installation

```sh
yarn add --dev @spotify/eslint-config-react eslint eslint-plugin-react eslint-plugin-jsx-a11y
```

## Usage

After installing, update your project's `.eslintrc.json` file to import the rule sets you want:

```js
{
  "extends" : [
    "@spotify/eslint-config-react"
  ]
}
```

---

Read the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information.
npm package: @spotify/eslint-config-typescript
Description: Spotify's ESLint config for TypeScript
Latest version: 15.0.0

# eslint-config-typescript

Spotify's TypeScript ESLint config extras.

## Installation

```sh
npm install --save-dev @spotify/eslint-config-typescript
```

## Usage

After installing, update your project's `.eslintrc.json` file to import the rule sets you want:

```js
{
  "extends" : [
    "@spotify/eslint-config-base",
    "@spotify/eslint-config-typescript"
  ]
}
```

---

Read the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information.
npm package: @spotify/eslint-plugin
Description: Set of rules for Spotify's custom ESLint rules
Author: Bilawal Hameed
Latest version: 15.0.0

# @spotify/eslint-plugin

This contains all Spotify-specific eslint rules.

## Installation

```sh
npm install --save-dev eslint @spotify/eslint-plugin
```

## Rules

| Category       | Name                                    | Description                                                                          |
| -------------- | --------------------------------------- | ------------------------------------------------------------------------------------ |
| Best Practices | [`best-practices/no-discouraged-words`] | Prevents usage of specific words. [See more][`best-practices/no-discouraged-words`]. |

[`best-practices/no-discouraged-words`]: https://github.com/spotify/web-scripts/blob/master/packages/eslint-spotify/src/rules/best-practices/no-discouraged-words.md

## Usage

After installing, update your project's `.eslintrc.json` config:

```js
{
  "plugins": ["@spotify/eslint-plugin"],
}
```

---

Read the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information.
npm package: @spotify/prettier-config
Description: Spotify's base Prettier config
Latest version: 15.0.0

# prettier-config

Spotify's base Prettier config.

## Installation

```sh
yarn add --dev @spotify/prettier-config
```

## Usage

After installing, update your project's `prettier.config.js` file to import the rule sets you want:

```js
module.exports = {
  ...require('@spotify/prettier-config'),
  // your overrides here
};
```

---

Read the [Prettier config docs](https://prettier.io) for more information.
npm package: @spotify/tsconfig
Description: Common tsconfigs to be used as your base configurations
Latest version: 15.0.0

# tsconfig

Check out our [docs on GitHub].

A collection of different base `tsconfig.json` to be extended from in your project.

This project aims to reduce per-project configuration as much as possible. With good defaults, we can focus on building, not configuration!

## Installation

Using npm or yarn:

```sh
yarn add --dev @spotify/tsconfig
```

For more information, check out our [docs on GitHub].

## Contributing

Try to optimize for the fewest specified options between the config specializations. For example, only `app` has `noEmit: true`, since the [default value][compiler options], `false`, is good for the `lib` config. Specifying it only in the `app` config means fewer overall entries!

We want to keep maintenance low by only specifying what is necessary. If the option's [default value][compiler options] is good for every config, remove it from every config!

[compiler options]: https://www.typescriptlang.org/docs/handbook/compiler-options.html
[docs on github]: ./docs