Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions adk/conversations/state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,25 @@ import { bot, user } from "@botpress/runtime"

const botId = bot.id
const userId = user.id
const userId = user.id
```

## User profile

In addition to state and tags, the `user` object exposes writable profile fields: `name`, `pictureUrl`, `properties`, and `attributes`. Changes are saved automatically at the end of the request.

```typescript
import { user } from "@botpress/runtime"

user.name = "Alice"
user.pictureUrl = "https://example.com/avatar.png"
user.properties.tier = "pro"
user.attributes.source = "webchat"
```

The `createdAt` and `updatedAt` timestamps are read-only:

```typescript
const created = user.createdAt
const updated = user.updatedAt
```
Loading