# attrsToSegments

**Kind:** Function

**Source:** [`atloria-monorepo/apps/api/src/tours/tour-targeting.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api/src/tours/tour-targeting.ts#L161)

D4 — flatten VERIFIED reader attrs (from the signed reader token, never a
host-declared string) into targetable segment strings. Each primitive value
yields both a bare segment (`enterprise`) and a namespaced one (`plan:enterprise`)
so an owner can target either; array values expand element-wise. This is what
segment rules evaluate against once a reader has a verified identity — a spoofed
`data-segments` can no longer grant a targeted experience.

## Signature

```ts
function attrsToSegments(attrs: Record<string, unknown> | null | undefined): string[]
```

## Parameters

| Name | Type |
|---|---|
| `attrs` | `Record<string, unknown> | null | undefined` |

**Returns:** `string[]`
