npm package: @stedi/sdk-client-stash
Description: Stedi SDK for JavaScript that includes Stash client for Node.js, Browser and React Native
Author: Stedi Team
Latest version: 0.4.78
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<!-- generated file, do not edit directly -->

# @stedi/sdk-client-stash

[![NPM version](https://img.shields.io/npm/v/@stedi/sdk-client-stash/latest.svg)](https://www.npmjs.com/package/@stedi/sdk-client-stash)
[![NPM downloads](https://img.shields.io/npm/dm/@stedi/sdk-client-stash.svg)](https://www.npmjs.com/package/@stedi/sdk-client-stash)
[![Stability Index](https://img.shields.io/badge/dynamic/json?color=yellow&url=https://unpkg.com/@stedi/sdk-client-stash/package.json&query=$.stability&label=stability)](https://github.com/dominictarr/stability)
[![Minimum Node.js version](https://img.shields.io/badge/dynamic/json?color=brightgreen&url=https://unpkg.com/@stedi/sdk-client-stash/package.json&query=$.engines.node&label=nodejs)](https://nodejs.org/)

## Description

Stedi Stash SDK for JavaScript.

Stash API specification.

For more information, read the [Getting Started Guide](/docs/stash).

All API endpoints are POST operations and any parameters
must be fully contained in the request body.

## Installing

To install the this package, simply type add or install @stedi/sdk-client-stash
using your favorite package manager:

- `npm install @stedi/sdk-client-stash`
- `yarn add @stedi/sdk-client-stash`
- `pnpm add @stedi/sdk-client-stash`

## Getting Started

### Initialize the client

First, create a new `StashClient`.

```ts
import { StashClient, CreateKeyspaceCommand } from "@stedi/sdk-client-stash";

const client = new StashClient({
  region: "us",
  apiKey: "my-api-key",
});
```

### Usage

Once the client is initiated, you may use it to send multiple commands.
If you are using a custom http handler, you may call `destroy()` to close open connections.

Create a command by creating a new `CreateKeyspaceCommand`.

```ts
import { StashClient, CreateKeyspaceCommand } from "@stedi/sdk-client-stash";

const client = new StashClient({
  region: "us",
  apiKey: "my-api-key",
});

const params = {
  /** input parameters */
};

const command = new CreateKeyspaceCommand(params);

try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}
```

### Troubleshooting

When the service returns an exception, the error will include the exception information,
as well as response metadata (e.g. request id).

```js
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by checking if it is a certain instance of exception:
   * if (error instanceof SomeServiceException) {
   *     const value = error.specialKeyInException;
   * }
   */
}
```

## License

This SDK is distributed under the
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),
see LICENSE for more information.

## Client Commands (Operations List)

<details>
<summary>
CreateKeyspace
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/CreateKeyspaceCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/CreateKeyspaceCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/CreateKeyspaceCommandOutput.html)

</details>
<details>
<summary>
DeleteKeyspace
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/DeleteKeyspaceCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/DeleteKeyspaceCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/DeleteKeyspaceCommandOutput.html)

</details>
<details>
<summary>
DeleteValue
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/DeleteValueCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/DeleteValueCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/DeleteValueCommandOutput.html)

</details>
<details>
<summary>
GetKeyspace
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/GetKeyspaceCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/GetKeyspaceCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/GetKeyspaceCommandOutput.html)

</details>
<details>
<summary>
GetValue
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/GetValueCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/GetValueCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/GetValueCommandOutput.html)

</details>
<details>
<summary>
IncrementValue
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/IncrementValueCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/IncrementValueCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/IncrementValueCommandOutput.html)

</details>
<details>
<summary>
ListKeyspaces
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/ListKeyspacesCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/ListKeyspacesCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/ListKeyspacesCommandOutput.html)

</details>
<details>
<summary>
ListValues
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/ListValuesCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/ListValuesCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/ListValuesCommandOutput.html)

</details>
<details>
<summary>
SetValue
</summary>

[Command API Reference](/docs/sdk/clients/stash/docs/classes/SetValueCommand.html) / [Input](/docs/sdk/clients/stash/docs/interfaces/SetValueCommandInput.html) / [Output](/docs/sdk/clients/stash/docs/interfaces/SetValueCommandOutput.html)

</details>