You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`XMTP_WALLET_KEY`| Private key for wallet |`XMTP_WALLET_KEY=0x1234...abcd`|
31
+
|`XMTP_ENV`| XMTP network environment (`local`, `dev`, or `production`) |`XMTP_ENV=dev` or `XMTP_ENV=production`|
32
+
|`XMTP_DB_ENCRYPTION_KEY`| Database encryption key for the local database (32 bytes, hex string with 0x prefix) |`XMTP_DB_ENCRYPTION_KEY=0xabcd...1234`|
33
33
34
34
Using the environment variables, you can setup your agent in just a few lines of code:
35
35
@@ -40,7 +40,7 @@ import { generatePrivateKey } from 'viem';
Copy file name to clipboardExpand all lines: docs/pages/agents/build-agents/group-permissions.mdx
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,14 @@
1
-
# Understand the group permissions system
1
+
# Understand group permissions
2
+
3
+
The group permissions system controls what actions different members can take in a group chat. This guide explains how the system works conceptually. For practical code examples of managing roles and permissions, see [Manage group chats](/agents/build-agents/groups).
2
4
3
5
## Member statuses
4
6
5
-
Member statuses are the roles that can be assigned to each participant (inbox ID) in a group chat. These are the available member statuses:
7
+
Member statuses are the roles that can be assigned to each participant (inbox ID) in a group chat:
6
8
7
-
- Member
8
-
- Everyone in a group chat is a member. A member can be granted admin or super admin status. If a member's admin or super admin status is removed, they are still a member of the group.
9
-
- Admin
10
-
- Super admin
9
+
-**Member** - Everyone in a group chat is a member. A member can be granted admin or super admin status. If a member's admin or super admin status is removed, they are still a member of the group.
10
+
-**Admin** - Members with elevated permissions
11
+
-**Super admin** - Highest permission level with full control over the group
11
12
12
13
## Options
13
14
@@ -79,3 +80,10 @@ If you aren't opinionated and don't set any permissions and options, groups will
79
80
- Update group metadata - All members
80
81
81
82
To learn more about the `All_Members` and `Admin_Only` policy sets, see [group_permissions.rs](https://github.com/xmtp/libxmtp/blob/85dd6d36f46db1ed74fe98273eea6871fea2e078/xmtp_mls/src/groups/group_permissions.rs#L1192-L1226) in the LibXMTP repo.
83
+
84
+
## Next steps
85
+
86
+
Now that you understand how the permission system works, see [Manage group chats](/agents/build-agents/groups) for practical code examples of:
Copy file name to clipboardExpand all lines: docs/pages/agents/build-agents/groups.mdx
+59-37Lines changed: 59 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,15 @@ Group chats can have metadata like names, descriptions, and images to help users
6
6
To learn more, see the [Gated group example](https://github.com/ephemeraHQ/xmtp-agent-examples/tree/main/examples/xmtp-gated-group) in the xmtp-agents-examples repo.
7
7
:::
8
8
9
-
## Available metadata fields
9
+
## Group metadata
10
+
11
+
### Available metadata fields
10
12
11
13
-`group_name`: The name of the group chat
12
14
-`description`: A description of the group chat
13
15
-`image_url`: A URL pointing to an image for the group chat
14
16
15
-
## Get and update metadata
17
+
###Get and update metadata
16
18
17
19
```js [Node]
18
20
// Get metadata
@@ -26,56 +28,46 @@ await group.updateDescription('New Group Description');
26
28
awaitgroup.updateImageUrl('newurl.com');
27
29
```
28
30
29
-
## Manage group chat membership
30
-
31
-
:::tip[Quickstart]
32
-
To learn more, see the [Gated group example](https://github.com/ephemeraHQ/xmtp-agent-examples/tree/main/examples/xmtp-gated-group) in the xmtp-agents-examples repo.
33
-
:::
31
+
## Group membership
34
32
35
33
The maximum group chat size is 250 members.
36
34
35
+
### Add members
36
+
37
+
Add members directly by their Ethereum addresses or by their inbox IDs:
Members can be assigned different roles with varying permission levels. To learn more about how the permission system works, see [Understand group permissions](/agents/build-agents/group-permissions).
97
+
98
+
### Available roles
99
+
100
+
-**Member** - Default role for all group participants
101
+
-**Admin** - Members with elevated permissions
102
+
-**Super admin** - Highest permission level (creator starts as super admin)
Copy file name to clipboardExpand all lines: docs/pages/agents/build-agents/local-database.mdx
+14-50Lines changed: 14 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,12 @@
2
2
3
3
Each XMTP agent installation maintains its own local database containing message history, conversation state, and cryptographic material. When you delete this database (or use an in-memory database), you create a new installation that counts toward your [installation limits](/chat-apps/core-messaging/manage-inboxes#inbox-update-and-installation-limits).
4
4
5
+
:::danger[CRITICAL FOR PRODUCTION]
6
+
7
+
Each time you run your agent, XMTP creates local database files that must be **kept between restarts and between deployments**. Without persistent volumes, each restart creates a new installation and you're **limited to 10 installations per inbox**.
8
+
9
+
:::
10
+
5
11
## Installation limits and revocation rules
6
12
7
13
Understanding XMTP's installation and inbox limits is critical for production deployments:
@@ -12,6 +18,7 @@ Understanding XMTP's installation and inbox limits is critical for production de
12
18
13
19
These limits protect inbox integrity and prevent unbounded key state growth across devices. For production environments, always use persistent volumes to back up and preserve your database across agent restarts.
14
20
21
+
15
22
## Understand local database files
16
23
17
24
The Agent SDK creates database files in the `dbPath` directory (default is `'/'`). These files store your agent's identity and message history.
-`62ff7c82fa2e8c9a0a0c9e58e7247704d102c41e5ceb4dc3573792d7d7a1c688`: Inbox ID (Your xmtp identity)
31
38
-`.db3`: SQLite database file extension
32
39
33
-
**Keep these files between deployments:**
34
-
35
-
- Deleting them creates a new installation each time
36
-
- Reusing them maintains the same installation
37
-
- Each inbox can have up to 10 installations
38
-
39
-
**For production deployments:**
40
-
41
-
- Use persistent volumes (Railway volumes, Render disks, etc.)
42
-
- The database needs to persist across restarts
43
-
44
-
:::warning[Note]
45
-
46
-
If you hit the 10 installation limit, use [this script](https://github.com/ephemeraHQ/xmtp-agent-examples?tab=readme-ov-file#revoke-installations) to revoke installations.
47
-
48
-
:::
49
40
50
41
## Understand installations
51
42
@@ -89,45 +80,18 @@ If you deploy your agent to this same network environment, you have 1 inbox with
89
80
/>
90
81
</div>
91
82
92
-
Here are some best practices for agent installation management:
93
-
94
-
- Configure your deployments to preserve the agent's database
95
-
- Consider how many platforms you'll need before hitting the 10 installation limit
96
-
- Keep track of which installation corresponds to which platform
97
-
- Regularly [check how many installations your agent has](/agents/deploy/debug-agents)
98
-
-[Revoke installations](#revoke-agent-installations) from platforms you no longer use
99
-
100
-
## Common agent installation scenarios
101
-
102
-
### Deploy to a new platform
103
-
104
-
When you deploy your agent to a new platform (e.g., from Railway to Fly.io):
105
-
106
-
- Your agent creates a new installation for the new platform
107
-
- If you already have 10 installations, you'll need to [revoke one first](#revoke-agent-installations)
108
-
- The new installation will start fresh without conversation history
109
-
110
-
### Update an existing deployment
111
-
112
-
When you redeploy your agent to the same platform:
113
-
114
-
- If the platform preserves the database, the same installation continues working
115
-
- If the platform doesn't preserve the database, a new installation is created
116
-
117
83
## Revoke agent installations
118
84
119
-
:::warning[Important]
85
+
When you revoke an agent installation, it can no longer send or receive messages. However, you can still access the local database. Your agent can still run from any active installations on other deployment platforms.
120
86
87
+
:::danger[Important]
121
88
Revoking an installation is permanent. You cannot recover access to a revoked installation.
122
-
123
89
:::
124
90
125
-
When you revoke an agent installation, it can no longer send or receive messages. However, you can still access the local database.
91
+
1. Web tool: [xmtp.chat/inbox-tools](https://xmtp.chat/inbox-tools)
92
+
2. CLI script: [revokeInstallations.ts](https://github.com/ephemeraHQ/xmtp-agent-examples/blob/eb1dc17e99570b77de906ba0d58094586a4af844/scripts/revokeInstallations.ts) in the xmtp-agent-examples repo
126
93
127
-
Your agent can still run from any active installations on other deployment platforms.
94
+
```bash
95
+
yarn revoke <inbox-id><installations-to-exclude>
96
+
```
128
97
129
-
To revoke an agent installation, use [revokeInstallations.ts](https://github.com/ephemeraHQ/xmtp-agent-examples/blob/eb1dc17e99570b77de906ba0d58094586a4af844/scripts/revokeInstallations.ts) in the xmtp-agent-examples repo. For example:
Copy file name to clipboardExpand all lines: docs/pages/agents/concepts/identity.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ When you call `Agent.create()`, the following steps happen under the hood:
36
36
37
37
The `dbEncryptionKey` client option is used by the Node, React Native, Android, and Swift SDKs only.
38
38
39
-
The encryption key is critical to the stability and continuity of an XMTP client. It encrypts the local SQLite database created when you call `Client.create()`, and must be provided every time you create or build a client.
39
+
The encryption key is used together with an auto-generated salt to encrypt the local database using [SQLCipher](https://www.zetetic.net/sqlcipher/). It encrypts the database created when you call `Agent.create()`.
40
40
41
41
This encryption key is not stored or persisted by the XMTP SDK, so it's your responsibility as the app developer to store it securely and consistently.
Copy file name to clipboardExpand all lines: docs/pages/agents/get-started/build-an-agent.mdx
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,9 +60,11 @@ await agent.start();
60
60
61
61
Each time you run your agent, XMTP creates local database files that must be **kept between restarts and between deployments**. Without persistent volumes, each restart creates a new installation and you're **limited to 10 installations per inbox**.
62
62
63
+
To learn more, see [Manage agent local database files and installations](/agents/build-agents/local-database).
64
+
63
65
:::
64
66
65
-
XMTP creates local database files in the `dbPath` (default is `'/'`) directory. These files store your device identity and message history. To learn more, see [Manage agent local database files and installations](/agents/build-agents/local-database).
67
+
XMTP creates local database files in the `dbPath` (default is `'/'`) directory. These files store your device identity and message history.
0 commit comments