---
title: "Attribute"
description: "This page lists the TypeScript SDK names for Attributes."
canonical_url: "https://docs.superdurable.io/reference/typescript/attribute/"
source: "docs/reference/typescript/attribute.mdx"
locale: "en"
---

# Attribute

This page lists the TypeScript SDK names for [Attributes](https://docs.superdurable.io/concepts/primitives/attribute.md).
The doc comment of each API gives its parameters, defaults, and errors. Read
them in the [TypeScript SDK API reference](https://docs.superdurable.io/reference/typescript.md#api-reference).

<a id="api-names"></a>

## API names

| Task                                             | TypeScript API                                                                                        | Dex behavior                                                                                                               |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Define a singleton Attribute                     | **Attribute**                                                                                         | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Define an AttributeMap                           | **AttributeMap**                                                                                      | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Declare it in the Flow                           | **attributes** of the **PersistenceSchema** returned from **getPersistenceSchema**                    | [Flow definition](https://docs.superdurable.io/reference/typescript/flow.md#flow-definition)                               |
| Read, write, and delete a value in a Step or RPC | **get**, **set**, and **delete**                                                                      | [Commits](https://docs.superdurable.io/reference/typescript/step.md#commit-boundary)                                       |
| Address one AttributeMap instance                | **AttributeMap.instance**, or the instance argument of **get**, **set**, and **delete**               | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Count AttributeMap instances and list their keys | **AttributeMap.getMapSize** and **AttributeMap.getAllInstanceKeys**                                   | [Selective state loading](https://docs.superdurable.io/reference/typescript/step-options.md#selective-state-loading)       |
| Load AttributeMap values for a method            | **AttributeMap.load**, with the load fields of **StepOptions** or **RPCOptions**                      | [Selective state loading](https://docs.superdurable.io/reference/typescript/step-options.md#selective-state-loading)       |
| Lock a value for a read-modify-write             | **lock**, with the lock fields of **StepOptions** or **lockAttributes** of **RPCOptions**             | [Locks](https://docs.superdurable.io/reference/server/runtime-data.md#attribute-locks)                                     |
| Index a value for search                         | **AttributeIndex** and **IndexType**                                                                  | [Indexes](https://docs.superdurable.io/reference/server/runtime-data.md#attribute-indexes)                                 |
| Project writes to an Attribute Store             | **syncToAttributeStore**                                                                              | [Attribute sync](https://docs.superdurable.io/reference/server/attribute-store-sync.md)                                    |
| Store a value that can be erased                 | **hardDeleteOnNull**                                                                                  | [Hard-delete Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#hard-delete-attributes)             |
| Set a value when the Flow starts                 | **attributes** of **StartFlowOptions**, with **InitialAttribute.of** or **InitialAttribute.mapValue** | [Attributes at start](https://docs.superdurable.io/reference/typescript/start-flow-options.md#attributes)                  |
| Read values from outside the Flow                | **Client.getAttributes**                                                                              | [Read Attributes](https://docs.superdurable.io/reference/server/runtime-client.md#read-attributes)                         |
| Wait until a value matches                       | **Client.waitForAttributeMatch**                                                                      | [Wait for an Attribute match](https://docs.superdurable.io/reference/server/runtime-client.md#wait-for-an-attribute-match) |

<a id="example"></a>

## Example

Example: [examples/typescript/src/primitives/attribute/attribute-flow.ts](https://github.com/superdurable/dex/tree/main/examples/typescript/src/primitives/attribute/attribute-flow.ts)
