# PluginData.set
Sets the value for a specific key

{/* Do not edit this file. It is automatically generated by API Documenter. */}

## PluginData.set() method

Sets the value for a specific key

**Signature:**

```typescript
set(key: string, value: string): void;
```

## Parameters

<table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        key
      </td>

      <td>
        string
      </td>

      <td>
        The key to set
      </td>
    </tr>

    <tr>
      <td>
        value
      </td>

      <td>
        string
      </td>

      <td>
        The value to set. If you want to set non-string values, you can serialize them to a string (e.g. using JSON.stringify) before storing.
      </td>
    </tr>
  </tbody>
</table>

**Returns:**

void

## Remarks

Will throw an error if setting this key-value pair would exceed the plugin's data quota for this node

## Example

```ts
// setting a string value
node.data.set("storedColors", "#FF0000");

// setting a non-string value
const colors = ["#FF0000", "#00FF00", "#0000FF"];
node.data.set("storedColors", JSON.stringify(colors));

// getting the stringified value back
const storedColors = JSON.parse(node.data.get("storedColors"));
```
