> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superblocks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using secrets

> Reference secrets from your secret stores in integration configuration forms

export const Alert = ({type, title, children}) => {
  const variant = ["info", "success", "warning", "danger", "note"].includes(type) ? type : "note";
  return <div className={`alert alert--${variant}`}>
      <div className="alert-icon" />
      <div className="alert-content">
        {title && <div className="alert-title">{title}</div>}
        <div className="alert-body">{children}</div>
      </div>
    </div>;
};

<br /> After an admin has [configured a secret store](/admin/secrets-management/overview), you can reference secrets in integration forms using the `{{sb_secrets}}` object.

<Alert type="info">
  Secrets can only be referenced in integration forms. They can't be referenced in any application code directly.
</Alert>

## Referencing secrets

Secrets are accessed from their respective stores using the syntax:

```js theme={null}
{{sb_secrets.STORE_NAME.SECRET_NAME}}
```

Use this syntax in an integration's configuration form, for fields such as a password, API key, or connection string.

Secrets are fetched at runtime from a particular store based on the API's current [**data tag**](/development-lifecycle/build/data-tags).

### JSON secrets

If your secret is stored as a JSON object in key:value form, use the JavaScript `JSON.parse()` function to reference the secret value:

```js theme={null}
{{JSON.parse(sb_secrets.STORE_NAME.SECRET_NAME).SECRET_KEY}}
```

### Special characters

If your secret name includes spaces or special characters, use array notation instead of dot notation:

```js theme={null}
{{sb_secrets.STORE_NAME['SECRET_NAME']}}
```

## Caching

An admin can configure caching for each secret store to reduce calls to the secrets manager and improve API performance. If you've recently rotated a secret and aren't seeing the new value, ask your admin to clear the cache for that secret store.

<Alert type="info">
  For more information on setting up and managing secret stores, see the <a href="/admin/secrets-management/overview">Secrets Management admin guide</a>.
</Alert>
