open-index/open-npm huggingface dataset:
npm package: @splunk/add-on-ucc-framework
Description: UCC framework is a build and code generation framework for building Splunk Add-ons (TAs)
Author: Splunk Inc.
Latest version: 6.0.1

# UCC-UI

This is a UI library that extends UCC with custom UI components.  It provides TypeScript-based components and hooks for building custom user interfaces.

## Getting Started

```bash
npm install --save @splunk/add-on-ucc-framework
# or
yarn add @splunk/add-on-ucc-framework
```

## Usage

Import a base class to extend for your custom UI components. If you're using TypeScript, you'll have static type support in lifecycle methods.

```tsx
import React from "react";
import ReactDOM from "react-dom";
import { CustomControlBase } from "@splunk/add-on-ucc-framework";

export default class MyCustomControl extends CustomControlBase {
  render() {
    ReactDOM.render(
      <input value={this.data.value} />,
      this.el,
    );
  }
}
```

Refer to the [splunk-example-ta](https://github.com/splunk/splunk-example-ta) repository for more examples.
npm package: @splunk/dashboard-extension-webpack-plugin
Description: Webpack plugin for building Splunk Enterprise dashboard extensions
Author: Splunk Inc.
Latest version: 3.0.1

# @splunk/dashboard-extension-webpack-plugin

A Webpack plugin for building Splunk dashboard extensions.

It replaces the initial `define` with a `require` so that the extension module is executed.

Consider using the dashboard configuration file provided by `@splunk/webpack-configs` instead of using this plugin directly.

## Install

Install the package:
```
npm install --save-dev @splunk/dashboard-extension-webpack-plugin
```

## Usage

Import and add the plugin to your webpack configuration:
```js
import DashboardPlugin from '@splunk/dashboard-extension-webpack-plugin';

{
    plugins: [new DashboardPlugin()]
}
```
npm package: @splunk/dashpub
Description: Generate next.js apps to publish Splunk dashboards
Latest version: 0.0.1-alpha5

# Dashboard Publisher

**EXPERIMENTAL** tool that creates a Next.js project for a given list of Splunk dashboards, optionally making the dashboards accessible to anyone using [Vercel](https://vercel.com). Search results are proxied through serverless functions, which handle authentication and efficient CDN caching.

## Prerequisites

-   Node.js 12+, NPM, Yarn
-   [Vercel CLI](https://vercel.com/download) if you want to publish on Vercel

## Get started

1. Install `dashpub` CLI globally

```sh-session
$ npm i -g @splunk/dashpub
```

2. Initialize a new project

```sh-session
$ dashpub init
```

Follow the instructions to create your dashboard project.

---

Copyright 2020 Splunk Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @splunk/moment
Description: Splunk timezone and formatting plugins for moment.js
Author: Splunk Inc.
Latest version: 0.7.0

# @splunk/moment

A package of [Moment](http://momentjs.com/) and [Moment Timezone](http://momentjs.com/timezone)
plugins for Splunk Enterprise timezones, and formatting for locales with second and millisecond precision.

## Install

Install the package:
```
npm install @splunk/moment
```

## Usage

Import moment from the Splunk UI package. This provides a Moment class with the timezone and
timezone util plugins.
```js
import moment from '@splunk/moment';
```

Create new moment instances in the server timezone and locale.
```js
const time1 = moment.newSplunkTime({time: 1490500800});
const time2 = moment.newSplunkTime({time: '10/10/2017', format: 'l'});
```

Manipulate and query times using the [Moment](http://momentjs.com/docs/) API.
```js
time1.subtract(1, 'day').startOf('day';);
const isBefore = time1.isBefore(time2);
```

Format Times using second or millisecond precision
```js
const displayValue = time1.splunkFormat('lls');
```

## Advanced Usage

If used in an environment without the `window.$C` properties set by `splunkweb`, there are
functions to setup and use the plugins with raw timezone data from Splunk Enterprise.

The timezone data can be retrieved from `services/search/timeparser/tz`. *To access this
service from the client, the endpoint must be exposed in web.conf.*

For example:
```
http://localhost:8000/en-US/splunkd/__raw/services/search/timeparser/tz
```

Set this data as the default Splunk Enterprise timezone, which can be used for creating and manipulating times.
```js
const splunkTimezoneName = moment.setDefaultSplunkTimezone(zoneData);

const time = moment.newSplunkTime({time: 1490500800}); // uses the default timezone
const nowInTokyo = moment.tz('Asia/Tokyo').locale('ja_JP');
const nowAtServer = nowInTokyo.clone().tz(splunkTimezoneName).locale('en_US');
```
npm package: @splunk/react-events-viewer
Description: This component provides the Events Viewer with the options to select your display style and configuration options like pagination and number of events.
Author: Splunk Inc.
Latest version: 28.5.3

# EventsViewer

This component provides the Events Viewer with the options to select your display style and configuration options like pagination and number of events.

To get started with @splunk/react-events-viewer:

## Install

```
npm install @splunk/react-events-viewer
```

Or

```
yarn add @splunk/react-events-viewer
```
npm package: @splunk/react-field-summary
Description: This component creates a field summary list container which categorizes the fields that are present in the events/results that are returned from a search job. The fields can be categorized and/or sorted in any way the consumer of this component chooses.
Author: Splunk Inc.
Latest version: 28.5.3

# FieldSummary

This component creates a field summary list container which categorizes the fields that are present in the events/results that are returned
from a search job. The fields can be categorized and/or sorted in any way the consumer of this component chooses.

## Install the package

```
npm install @splunk/react-field-summary
     --or--
yarn add @splunk/react-field-summary
```
npm package: @splunk/react-icons
Description: Library of various React icons
Author: Splunk Inc.
Latest version: 5.10.0

# @splunk/react-icons

A library of various icons in React.

## Install

Install the package and its dependencies.

1. Install the peer dependencies:
    ```
    npm install react@^16 react-dom@^16 styled-components@^5
    ```
2. Install the package:
    ```
    npm install @splunk/react-icons
    ```

## Production builds

Both `@splunk/react-icons` and React support production and development builds. The production build removes warnings and guidance from the output. To create a production build, set the environment variable `NODE_ENV` to `"production"` and use the webpack [DefinePlugin](https://webpack.js.org/plugins/define-plugin/) to inject the variable into the code.
npm package: @splunk/react-page
Description: Load React components into the latest layout from Splunk Enterprise
Author: Splunk Inc.
Latest version: 8.3.1

# @splunk/react-page

Loads a React component into the latest layout from the Splunk Enterprise server, including
the Splunk bar, app bar, and a footer around your page content.

This package dynamically loads the Layout API from the correct location.

Using this package requires `splunkd` partials to be loaded on the page.

## Install

Install the package and its dependencies.

1. Install the peer dependencies:
    ```
    npm install react@^16 react-dom@^16 styled-components@^5
    ```
2. Install the package:
    ```
    npm install @splunk/react-page
    ```

## Usage
In a basic scenario, the layout takes a React element and an optional options object.

```js
import layout from '@splunk/react-page';
import MyPage from 'pages/MyPage';

layout(<MyPage />, { pageTitle: 'A React Page', hideFooter: true, layout: 'fixed' });
```

### React 18
To use the new [createRoot](https://react.dev/reference/react-dom/client/createRoot#createroot) functionality introducted in React 18, use the `'@splunk/react-page/18'` import instead of `@splunk/react-page`.

```js
import layout from '@splunk/react-page/18';
import MyPage from 'pages/MyPage';

layout(<MyPage />, { pageTitle: 'A React Page', hideFooter: true, layout: 'fixed' });
```
npm package: @splunk/react-selection-actions
Description: A component to standardize the actions to take on the selected rows in a table
Author: Splunk Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Selection Actions

A component to standardize the actions to take on the selected rows in a table

## Install the package

```
npm install @splunk/react-selection-actions
     --or--
yarn add @splunk/react-selection-actions
```
npm package: @splunk/react-sparkline
Description: React sparkline chart components
Author: Splunk Inc.
Latest version: 0.6.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @splunk/react-sparkline

A library of React sparkline chart components.

## Install

Install the package and its dependencies.

1. Install the peer dependencies:
    ```
    npm install react@^16 react-dom@^16 styled-components@^5
    ```
2. Install the package:
    ```
    npm install @splunk/react-sparkline
    ```
npm package: @splunk/react-time-range
Description: A Splunk time range picker built with React.
Author: Splunk Inc.
Latest version: 12.0.0

# @splunk/react-time-range

Time range picker components and supporting utils for working with splunkweb.

## Install

```
npm install @splunk/react-time-range
```

Or

```
yarn add @splunk/react-time-range
```

## Base Components vs Splunkweb Components

-   The Base Components have been completely isolated from Splunkweb, so they may be ported to other
    systems. However, it doesn't have capabilities that require Splunkweb:
    -   No support for epoch times. Only ISO is supported.
    -   Relative time strings cannot be previewed.
    -   Presets must be provided.
-   Splunkd components require several \$C variables to be defined:
    -   locale
    -   splunkdPath
npm package: @splunk/react-toast-notifications
Description: React toast notification components
Author: Splunk Inc.
Latest version: 0.13.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @splunk/react-toast-notifications

> **Deprecated:** Toast notifications are deprecated in the Splunk UI design system and should not be used for new experiences. Use [Message](../react-ui/Message) or [MessageBar](../react-ui/MessageBar) instead. See [Notifications guidance](../react-ui/Notifications) for migration recommendations.


Legacy package for existing applications that still depend on toast behavior.

## Install

Install only if you are maintaining existing toast implementations.

1. Install the peer dependencies:
    ```
    npm install react@^16 styled-components@^5
    ```
2. Install the package:
    ```
    npm install @splunk/react-toast-notifications
    ```

## Usage

Legacy usage for existing apps only. Only import these **once**. See Usage for details.
```js
import ToastMessages from '@splunk/react-toast-notifications/ToastMessages';
import Toaster, { makeCreateToast } from '@splunk/react-toast-notifications/Toaster';
```
```js
import { TOAST_TYPES } from '@splunk/react-toast-notifications/ToastConstants';
```

## Production builds

Both `@splunk/react-toast-notifications` and React support production and development builds. The production build removes warnings and guidance from the output. To create a production build, set the environment variable `NODE_ENV` to `"production"` and use the webpack [DefinePlugin](https://webpack.js.org/plugins/define-plugin/) to inject the variable into the code.
npm package: @splunk/react-visualization-utils
Description: Utilities for fetching, parsing, evaluating and manipulating visualization props.
Author: Splunk Inc.
Latest version: 2.2.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# React Visualization Utils

Utilities for fetching, parsing, evaluating and manipulating visualization props.

The library comes with typescript declaration file which will provide documentation inline in development environments.

## Install

```
npm install @splunk/react-visualization-utils
```

Or

```
yarn add @splunk/react-visualization-utils
```
npm package: @splunk/rum-build-plugins
Description: Build plugins for users of @splunk/otel-web
Author: Splunk Observability Instrumentals Team
Latest version: 2.3.0

# Splunk RUM Build Plugins

Use the `SplunkRumWebpackPlugin` to upload your application's source maps to Splunk RUM. This enables automatic source mapping of your JavaScript errors, resulting in more readable stack traces that are easier to debug.

Current plugin support is for Webpack 5 only.

## Installation

```
npm install @splunk/rum-build-plugins --save-dev
```

## Usage

Make sure that your `webpack.config.js` is configured to generate source maps,
then add the `SplunkRumWebpackPlugin` to the list of plugins:

```js
// webpack.config.js

const { SplunkRumWebpackPlugin } = require('@splunk/rum-build-plugins')

module.exports = {
	/* ... */
	plugins: [
		new SplunkRumWebpackPlugin({
			sourceMaps: {
				realm: '<realm>',
				token: '<splunk-org-access-token>',

				// Optional: conditionally set 'disableUpload' so that file uploads
				// are only performed during your production builds on your CI pipeline
				disableUpload: '<boolean>',
			},
		}),
	],
}
```

The `token` must be an [org access token](https://help.splunk.com/en/splunk-observability-cloud/administer/authentication-and-security/authentication-tokens/org-access-tokens)
with an authorization scope of API token (not RUM token) and `power` role.
npm package: @splunk/rum-cli
Description: Tools for handling symbol and mapping files for symbolication
Author: Splunk
Latest version: 1.0.0

![Status](https://img.shields.io/badge/status-under%20development-informational?style=for-the-badge)
![Build Status](https://img.shields.io/github/actions/workflow/status/signalfx/splunk-rum-cli/.github/workflows/ci.yml?branch=main&style=for-the-badge)
![GDI Specification](https://img.shields.io/badge/GDI-1.7.0-blueviolet?style=for-the-badge)
![NPM](https://img.shields.io/npm/v/@splunk/rum-cli?style=for-the-badge)
![Node](https://img.shields.io/node/v/@splunk/rum-cli?style=for-the-badge)

# Splunk RUM CLI

The Splunk RUM CLI is a tool for uploading Android mapping files, iOS dSYM files, and browser source map files to the Splunk Observability Cloud back end for deobfuscating or symbolicating stack traces. This tool is part of the Splunk Real User Monitoring (RUM) suite.

## Features

* Uploading and listing of Android Proguard mapping files
* Uploading and listing of iOS dSYM mapping files
* Performing JavaScript bundle modifications to enable automatic source mapping
* Uploading JavaScript source map files

## Documentation

For official documentation on the Splunk RUM CLI, see
[Install the splunk-rum CLI](https://quickdraw.splunk.com/redirect/?product=Observability&location=rum.buildintegration&version=current)

## Getting Started

To install the CLI from npm, run:
```
npm install -g @splunk/rum-cli
```

After installing, for an overview of the splunk-rum CLI and available commands, run:
```
splunk-rum
```

## Build and Development

To build locally, run:

```
npm install
npm run build
npm link
```

You can now run `splunk-rum` locally from the command line:
```
splunk-rum --version
```

To develop locally, you can use the `build:watch` script to automatically rebuild the project as you make changes:
```
npm run build:watch
```

# License

The Splunk RUM CLI is licensed under the terms of the Apache Software License
version 2.0. See [the license file](./LICENSE) for more details.
npm package: @splunk/search-job
Description: Create and access Splunk Enterprise search jobs
Author: Splunk Inc.
Latest version: 3.1.0

# @splunk/search-job

A class that simplifies creating and accessing Splunk search jobs.

## Install

Install the package:
```
npm install @splunk/search-job
```

## Usage
```js
import SearchJob from '@splunk/search-job';
```

The API of the SearchJob class is based on [Observables](http://reactivex.io/rxjs/manual/overview.html#introduction). Each method returns an Observable that can be subscribed to and will emit data over the lifecycle of the search job. A few examples are provided here.

### Create a Simple SearchJob
```js
const mySearchJob = SearchJob.create({
    search: 'index=_internal | head 10',
    earliest_time: '-60m@m',
    latest_time: 'now',
});
```

### Create a SearchJob in a Specific Context
```js
const mySearchJob = SearchJob.create({
    search: 'index=_internal | head 10',
    earliest_time: '-60m@m',
    latest_time: 'now',
}, {
    app: 'awesome_app',
    owner: 'admin',
});
```

### Create a SearchJob from a Saved Search
```js
const mySearchJob = SearchJob.fromSavedSearch({
    name: 'My Saved Search',
    app: 'search',
    owner: 'admin',
});
```

### Get Search Progress
```js
const progressSubscription = mySearchJob.getProgress().subscribe(searchState => {
    // Do something with the searchState.
});

// Later, if the search is no longer needed, and is not complete,
// unsubscribe to release resources.
progressSubscription.unsubscribe();
```

### Get Search Results
Search results will only emit when the search is complete. See `getResultsPreview` to get a preview of results before the search is complete.
```js
const resultsSubscription = mySearchJob.getResults().subscribe(results => {
    // Do something with the results.
});

// Later, if the results are no longer needed, and the search is not complete,
// unsubscribe to release resources.
resultsSubscription.unsubscribe();
```

### Errors and Completion
All Observables support three callbacks: `next`, `error`, and `complete`.
```js
const progressSubscription = mySearchJob.getProgress().subscribe({
    next: searchState => {
        // Do something with the search state.
    },
    error: err => {
        // The search failed. Do something with the err.
    },
    complete: () => {
        // The search has completed successfully.
    },
});
```
npm package: @splunk/splunk-ui-mcp
Description: Model Context Protocol server for the Splunk UI Design System
Author: Splunk Inc.
Latest version: 0.4.0

# @splunk/splunk-ui-mcp

A Model Context Protocol (MCP) server that gives AI assistants Splunk UI Design System documentation, including:
- Version requirements for building with Splunk UI packages
- Component documentation and usage guidance
- Design pattern best practices
- Icon search and metadata

## Requirements

- Node.js 22 or newer
- An MCP-compatible client (VS Code, Cursor, Windsurf, Claude Desktop, Goose, etc.)
- Access to @splunk/react-ui, @splunk/react-icons, and @splunk/themes

## Install and configure

### Option 1: Tool-specific commands
#### CLI
```bash
# Claude CLI
claude mcp add splunk-ui -- npx @splunk/splunk-ui-mcp@latest

# Codex
codex mcp add splunk-ui -- npx @splunk/splunk-ui-mcp@latest
```

#### Install Links (copy and paste these URLs into your browser):
```bash
# VS Code
vscode:mcp/install?%7B%22name%22%3A%22splunk-ui%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22%40splunk/splunk-ui-mcp%40latest%22%5D%7D
  
# Cursor:
cursor://anysphere.cursor-deeplink/mcp/install?name=splunk-ui&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAc3BsdW5rL3NwbHVuay11aS1tY3BAbGF0ZXN0Il19
```

### Option 2: Manual npx configuration (universal)
Use `npx` in your MCP client configuration (works in most tools):

```js
{
  "mcpServers": {
    "splunk-ui": {
      "command": "npx",
      "args": ["@splunk/splunk-ui-mcp@latest"]
    }
  }
}
```

To pin a version, replace `@latest` with the desired version.

## Reference

If you need the underlying tool, resource, or prompt names (for debugging or client integrations), use the list below.

### Tools

- `find_component`: Find `@splunk/react-ui` components by exact name or fuzzy query; returns full docs for exact matches and suggestions otherwise.
- `find_icon`: Search `@splunk/react-icons` and return a recommended icon plus alternatives.
- `find_design_token`: Search `@splunk/themes` design tokens and return recommended matches.
- `list_splunk_ui_requirements`: Return version requirements and peer dependencies.

### Resources

**Component documentation**

```
mcp://splunk-ui/components/{componentName}
```

**Icon catalog**

```
mcp://splunk-ui/icons/{iconName}
```

**Design tokens**

```
mcp://splunk-ui/design-tokens/{tokenName}
```

### Prompts

- `audit_code`: Audit code against Splunk UI Design System guidelines.
- `build_ui`: Implement a Figma design or text description using Splunk UI components.
- `create_scaffold`: Scaffold new Splunk UI standalone apps.
- `session_feedback`: Generate quality feedback report on MCP tools, prompts, and resources.

## Troubleshooting

- Ensure Node.js 22+ is installed and available in your PATH
  - `No server info found` error: This usually means an older Node.js version
- Try running `npx @splunk/splunk-ui-mcp@latest --version` to test connectivity
- Restart your development tool after adding the configuration
npm package: @splunk/stylelint-config
Description: Standardized Splunk stylelint configuration
Author: Splunk Inc.
Latest version: 5.0.0

# @splunk/stylelint-config

A standardized stylelint config. It's designed to work well with `styled-components`
and `prettier`, but can be used independently as well.

## Install

Install the package and its dependencies.

1. Install the peer dependencies:
    ```
    npm install --save-dev stylelint@^13
    ```
2. Install the package:
    ```
    npm install --save-dev @splunk/stylelint-config
    ```

## Usage

Add the package to your stylelint configuration file. If you don't have one, create `stylelint.config.js` in
the root directory of your package.

```js
module.exports = {
    extends: '@splunk/stylelint-config'
};
```
npm package: @splunk/themes
Description: Theme variables and mixins for the Splunk design language
Author: Splunk Inc.
Latest version: 1.7.0

# @splunk/themes

A collection of Splunk software theme variables and mixins. This package provides functions that can be useful in React, styled-components and other frameworks.
Themes consist of plain objects containing primitives such as strings and numbers. Functions are used for mixins.

## Install

Install the package:
```bash
yarn add @splunk/themes

-or-

npm install @splunk/themes

```

`react@^18` and `styled-components@^5"` are required peer dependencies for all capabilities except `getTheme()`.

## React Usage
A theme context is created at the root of the application using `SplunkThemeProvider`.

```js
import SplunkThemeProvider from '@splunk/themes/SplunkThemeProvider';

<SplunkThemeProvider family="prisma" density="compact" colorScheme="light">
     ...
</SplunkThemeProvider>;
```

## Styled Components Usage

Components are themed using `pick()`, `variables`, `mixins`.

```js
import { pick, variables, mixins } from '@splunk/themes';
import styled from 'styled-components';

const Wrapper = styled.div`
    ${mixins.reset()};

    color: ${pick({
         enterprise: variables.textColor,
         prisma: variables.contentColorDefault
    })};
`;
```


## Generic Usage
Theme variables are also available outside of React and styled-components.

```js
import getTheme from '@splunk/themes/getTheme';

const baseTheme = getTheme({family: 'prisma', colorScheme: 'light', density: 'compact' });

console.log(baseTheme.family, baseTheme.focusColor);
```
npm package: @splunk/time-range-utils
Description: Utilities for fetching, parsing, evaluating and manipulating time ranges.
Author: Splunk Inc.
Latest version: 3.4.1

# @splunk/time-range-utils

Utilities for fetching, parsing, evaluating and manipulating time ranges.

## Install

```
npm install @splunk/time-range-utils
```

Or

```
yarn add @splunk/time-range-utils
```

## IE11 and Safari Support

The `timeParser` module relies on `window.fetch` and `window.Promise`. IE11 requires a polyfill
for both. Safari 10.0 and lower require a polyfill for fetch. Since polyfills create globals, they
are not included in the `@splunk/time-range-utils` package. To support these browsers, ensure
polyfills, such as `whatwg-fetch` and `promise-polyfill`, are included as a part of your build.

The `time` module does not use `window.fetch` or `window.Promise`.
npm package: @splunk/ui-utils
Description: Library of common UI utilities
Author: Splunk Inc.
Latest version: 1.13.0

# @splunk/ui-utils

A library of common UI utilities.

## Install

```
npm install @splunk/ui-utils
```

## Usage

Individual functions can be imported from several named modules.

Boolean example:
```js
import { normalizeBoolean } from '@splunk/ui-utils/boolean';
```

Cookie example:
```js
import { getEntry } from '@splunk/ui-utils/cookie';
```

Filter example:
```js
import { filterByKeywords } from '@splunk/ui-utils/filter';
```

Focus example:
```js
import { takeFocus } from '@splunk/ui-utils/focus';
```

Format example:
```js
import { smartTrim } from '@splunk/ui-utils/format';
```

Id example:
```js
import { createDOMID } from '@splunk/ui-utils/id';
```

Internationalization example:
```js
import { _ } from '@splunk/ui-utils/i18n';
```

Keyboard example:
```js
import { isNumber } from '@splunk/ui-utils/keyboard';
```

Math example:
```js
import { strictParseFloat } from '@splunk/ui-utils/math';
```

Scroll example:
```js
import { scrollIntoViewIfNeeded } from '@splunk/ui-utils/scroll';
```

Style example:
```js
import { toClassName } from '@splunk/ui-utils/style';
```

User Agent example:
```js
import { isIE11 } from '@splunk/ui-utils/userAgent';
```
npm package: @splunk/webpack-configs
Description: Standardized webpack configuration files for apps and components
Author: Splunk Inc.
Latest version: 7.0.3

# @splunk/webpack-configs

Standardized webpack configuration files for apps and components.

## Install

Install the package and its dependencies.

1. Install the peer dependencies:
    ```
    npm install --save-dev @babel/core@^7 babel-loader@^8 webpack@^4
    ```
2. Install the package:
    ```
    npm install --save-dev @splunk/webpack-configs
    ```

## Usage

### Base Configuration

```
const webpackMerge = require('webpack-merge');
const baseConfig = require('@splunk/webpack-configs').default;

module.exports = webpackMerge(baseConfig, {
    entry: {...},
    output: {...},
});
```

### Component Library

A configuration for building a library of shareable components.
```
const webpackMerge = require('webpack-merge');
const baseComponentConfig = require('@splunk/webpack-configs/component.config').default;

module.exports = webpackMerge(baseComponentConfig, {
entry: {...},
output: {...},
});
```

### Dashboard Extensions

```
const webpackMerge = require('webpack-merge');
const baseDashboardConfig = require('@splunk/webpack-configs/dashboard.config').default;

module.exports = webpackMerge(baseDashboardConfig, {
    entry: {...},
    output: {...},
});
```

`@splunk/dashboard-extension-webpack-plugin` must be added as a dev dependency if this configuration is used.

### Options

All configurations export a `create` function that accepts the following options:
* `babelTypescript` - Includes `.ts` and `.tsx` files in the `babel-loader` configuration used by
all configurations. Defaults to `true`.

```
const webpackMerge = require('webpack-merge');
const createBaseConfig = require('@splunk/webpack-configs').create;

module.exports = webpackMerge(createBaseConfig({ babelTypescript: false }), {
    entry: {...},
    output: {...},
});
```
npm package: @splunkdev/cloud-auth-common
Description: Splunk Cloud Common Authentication Library for JavaScript
Author: Splunk, Inc.
Latest version: 2.3.0

# Splunk Cloud Services Cloud-Auth-Common

[![Build Status](https://github.com/splunk/splunk-cloud-auth-js/workflows/Build%20and%20Run%20Tests/badge.svg?branch=master)](https://github.com/splunk/splunk-cloud-auth-js/actions?query=workflow%3A%22Build+and+Run+Tests%22+branch%3Amaster)
[![codecov](https://codecov.io/gh/splunk/splunk-cloud-auth-js/branch/master/graphs/badge.svg)](https://codecov.io/gh/splunk/splunk-cloud-auth-js)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

Splunk Cloud Services Cloud-Auth-Common contains an authentication library with common code used in the [@splunkdev/cloud-auth-client](https://github.com/splunk/splunk-cloud-auth-js/tree/master/packages/cloud-auth-client) and [@splunkdev/cloud-auth-node](https://github.com/splunk/splunk-cloud-auth-js/tree/master/packages/cloud-auth-node) packages.

## Terms of Service

[Splunk Cloud Services Terms of Service](https://auth.scp.splunk.com/tos)

## Get started

Install the `@splunkdev/cloud-auth-common` package to enable your project to authenticate with Splunk Cloud Services.

Run the following command from your project directory if you use Yarn:

```sh-session
yarn add @splunkdev/cloud-auth-common
```

Run the following command from your project directory if you use npm:

```sh-session
npm install --save @splunkdev/cloud-auth-common
```

## Documentation

For Splunk Cloud Services documentation, see the [Splunk Developer Portal](https://dev.splunk.com/scs/).

## Contact

If you have questions, reach out to us on [Slack](https://splunkdevplatform.slack.com) in the **#sdc** channel or email us at _devinfo@splunk.com_.
npm package: @splunkdev/cloud-sdk
Description: Splunk Cloud SDK for Javascript
Author: Splunk, Inc.
Latest version: 16.0.0-beta6

# Splunk Cloud Services SDK for JavaScript

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

The Splunk Cloud Services software development kit (SDK) for JavaScript contains library code and examples to enable you to build apps using the Splunk Cloud Services services with the JavaScript programming language.

## Terms of Service (TOS)
[Splunk Cloud Services Terms of Service](https://auth.scp.splunk.com/tos)

Log in to [Splunk Investigate](https://si.scp.splunk.com/) and accept the Terms of Service when prompted.

## Get started

### Install the SDK

Install the SDK to enable your app project to interact with Splunk Cloud Services services.

Run the following command from your project directory:

```sh
npm install @splunkdev/cloud-sdk
```

### Example usage

This example shows how to use one service client to access all supported services:

```js
require('isomorphic-fetch'); // or a fetch polyfill of your choosing

const { SplunkCloud } = require('@splunkdev/cloud-sdk');

const svc = new SplunkCloud({ tokenSource: AUTH_TOKEN, defaultTenant: TENANT });

// Retrieve the datasets for this tenant from the Catalog service
svc.catalog.getDatasets();

// Run a search on the "main" index
svc.search.createJob({ "query": "| from index:main | head 5" });

...

```

If your app needs to work with one specific service, use a specific client for only the required service as follows:

```javascript
require('isomorphic-fetch'); // or a fetch polyfill of your choosing

const { IdentityService } = require('@splunkdev/cloud-sdk/services/identity');

const ENDPOINT_URL = "https://api.scp.splunk.com";

const identity = new IdentityService(ENDPOINT_URL, AUTH_TOKEN, TENANT);

// Get the user profile from the Identity API
identity.getPrincipal(PRINCIPAL_NAME);

...

```

## Documentation
For general documentation, see the [Splunk Developer Portal](https://dev.splunk.com/scs/).

For reference documentation, see the [Splunk Cloud Services SDK for JavaScript API Reference](https://dev.splunk.com/scs/reference/sdk/splunk-cloud-sdk-js).

## Contributing

A detailed quickstart guide for setting up a development environment and contributing to this project [can be found here](https://github.com/splunk/splunk-cloud-sdk-js/wiki/Development).

Do not directly edit any source file in the `/src/generated` directory because these files were generated from service specifications.

## Contact
If you have questions, reach out to us on [Slack](https://splunkdevplatform.slack.com) in the **#sdc** channel or email us at _devinfo@splunk.com_.
npm package: @splunkdlt/async-tasks
Description: Generic helpers around asynchronous tasks, parallel execution, retrying and aborting them.
Author: Splunk
Latest version: 1.1.0

# @splunkdlt/async-tasks

Generic helpers around asynchronous tasks, parallel execution, retrying and aborting them.

### Retrying asynchronous tasks

The library provides a helper function `retry()` that allows to execute asynchronous tasks with retries when the task fails.

Example:

<!-- EXAMPLE:retry_example:simple1:START -->

```typescript
const result = await retry(performAsyncTask, {
    attempts: 10,
    waitBetween: exponentialBackoff({ min: 10, max: 500 }),
});
```

<!-- EXAMPLE:retry_example:simple1:END -->

### Parallel execution of tasks

A helper function called `parallel()` can help execute a list of asynchronous tasks in parallel allowing only a certain number of tasks to run at the same time. This is conceptually similar to an execution pool, allowing for constraining the resources used be a set of tasks.

Example:

<!-- EXAMPLE:parallel_example:START -->

```typescript
const TASKS = [...Array(10)].map((_, i) => async () => {
    const taskNumber = i + 1;
    console.log('Starting task', taskNumber);
    await sleep(100 + Math.floor(Math.random() * 1000));
    console.log('Completed task', taskNumber);
    return taskNumber;
});

const results = await parallel(TASKS, { maxConcurrent: 3 });

console.log(results); // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
```

<!-- EXAMPLE:parallel_example:END -->

### AbortHandle

Another aspect of this library deals with aborting the execution of asynchronous tasks. An `AbortHandle` is the primitive this libaray provides to make it happen - it tracks the aborted-state and allows to register callbacks when an abort is triggered. An `abortHandle` can also be passed to both `parallel()` and `retry()`.

Example:

<!-- EXAMPLE:abort_example:START -->

```typescript
const abortHandle = new AbortHandle();

setTimeout(() => abortHandle.abort(), 100);

const start = Date.now();
try {
    await abortHandle.race(sleep(1000));
} catch (e) {
    if (abortHandle.aborted) {
        console.log('Aborted!');
    }
}

console.log('Complete after', Date.now() - start, 'ms');
```

<!-- EXAMPLE:abort_example:END -->
npm package: @splunkdlt/debug-logging
Description: Wrapper around [debug](https://yarnpkg.com/en/package/debug) creating a set of structured debug loggers with a common name prefix.
Author: Splunk
Latest version: 1.0.2

# @splunkdlt/debug-logging

Wrapper around [debug](https://yarnpkg.com/en/package/debug) creating a set of structured debug loggers with a common name prefix.
npm package: @splunkdlt/hec-client
Description: ![Integration Tests](https://github.com/splunk/dlt-connect-libs/workflows/HEC%20Client%20Integration%20Tests/badge.svg)
Author: Splunk
Latest version: 1.2.1

# @splunkdlt/hec-client

![Integration Tests](https://github.com/splunk/dlt-connect-libs/workflows/HEC%20Client%20Integration%20Tests/badge.svg)

Flexible client library for Splunk HTTP Event Collector (HEC) with support for sending metrics and events, batching, compression, keep-alives and retries.

## Install and Use

```sh-session
npm i @splunkdlt/hec-client

# or

yarn add @splunkdlt/hec-client
```

Example: sending some metrics to HEC:

<!-- EXAMPLE:system-metrics:START -->

```typescript
const hec = new HecClient({
    url: 'https://http-inputs-acme.splunkcloud.com',
    token: '12345678-9999-4711-0815-C0FF33C0FFEE',
});

const mem = process.memoryUsage();
const cpu = process.cpuUsage();

hec.pushMetrics({
    time: Date.now(),
    measurements: {
        'myapp.cpu.user': cpu.user,
        'myapp.cpu.system': cpu.system,
        'myapp.mem.heapUsed': mem.heapUsed,
        'myapp.mem.heapTotal': mem.heapTotal,
    },
    fields: {
        hostname: os.hostname(),
    },
    metadata: {
        index: 'mymetrics',
        sourcetype: 'myapp:system',
        source: 'myapp',
    },
});

await hec.flush();
```

<!-- EXAMPLE:system-metrics:END -->
npm package: @splunkdlt/managed-resource
Description: A set of helpers to perform an orderly shutdown of a collector process.
Author: Splunk
Latest version: 1.1.0

# @splunkdlt/managed-resource

A set of helpers to perform an orderly shutdown of a collector process.

### Example

The following example illustrates a tyipcal flow of a program using the managed-resource package:

<!-- EXAMPLE:shutdown_example:START -->

```typescript
const testResource = new TestResource();
const resources = [testResource];
try {
    await Promise.race([runMainBackgroundJob(testResource), waitForSignal('SIGINT'), waitForSignal('SIGHUP')]);
} catch (e) {
    console.error('Caught unexpected error', e);
} finally {
    const cleanShutdown = await shutdownAll(resources, 60_0000);
    console.log('Shutdown complete');
    process.exit(cleanShutdown ? 0 : 1);
}
```

<!-- EXAMPLE:shutdown_example:END -->

Resources passed to `shutdownAll()` need to implement the `ManagedResource` interface - which mainly requires to provide a `shutdown()` method.

<!-- EXAMPLE:shutdown_example:resource:START -->

```typescript
class TestResource implements ManagedResource {
    // ...

    async shutdown() {
        console.log('Shutting down test resource');
        await sleep(500);
        console.log('Test resource shutdown complete');
    }
}
```

<!-- EXAMPLE:shutdown_example:resource:END -->
npm package: @splunkdlt/prometheus-scraper
Description: Utility to help scrape metrics from apps exposing prometheus-style metrics endpoints.
Author: Splunk
Latest version: 0.2.0

# @splunkdlt/prometheus-metrics

Utility to help scrape metrics from apps exposing prometheus-style metrics endpoints.

## Example Usage

<!-- EXAMPLE:simple-scraper:START -->

```typescript
while (running) {
    const scrapeResult = await scrapePrometheusMetrics({
        url: 'http://localhost:8080/debug/metrics/prometheus',
    });

    const convertedMetrics = convertToHecMultiMetrics(scrapeResult.metrics, {
        captureTimestamp: Date.now(),
        namePrefix: 'geth',
        metadata: {
            host: os.hostname(),
            source: 'geth:metrics:prometheus',
        },
    });

    for (const hecMetrics of convertedMetrics) {
        hec.pushMetrics(hecMetrics);
    }

    await sleep(5_000);
}
```

<!-- EXAMPLE:simple-scraper:END -->