|
1 | 1 | # XMTP Full Documentation |
2 | 2 |
|
3 | | -Generated at 10:13 PM UTC / October 28, 2025 |
| 3 | +Generated at 02:16 AM UTC / November 05, 2025 |
4 | 4 |
|
5 | 5 | ## Instructions for AI Tools |
6 | 6 |
|
@@ -13222,20 +13222,9 @@ Every app and agent needs an XMTP Gateway Service. |
13222 | 13222 |
|
13223 | 13223 | ### For browser and mobile client apps |
13224 | 13224 |
|
13225 | | -You must run the XMTP Gateway Service written in Go. Choose the option that works best for you: |
| 13225 | +Use the [example gateway service repository](https://github.com/xmtp/gateway-service-example) as a starting point to build your own custom gateway with authentication |
13226 | 13226 |
|
13227 | | -**Option 1: Basic Docker image** (No Go knowledge required) |
13228 | | - |
13229 | | -- XMTP provides a Docker image that works out of the box |
13230 | | -- Authorizes all requests (add authentication for production) |
13231 | | -- Suitable for testing |
13232 | | - |
13233 | | -**Option 2: Custom implementation** (Go knowledge required) |
13234 | | - |
13235 | | -- Start with XMTP's Go implementation |
13236 | | -- Add your own authentication logic |
13237 | | -- Implement custom rate limiting |
13238 | | -- Required for apps with authentication needs |
| 13227 | +For detailed implementation steps, see [Deploy your XMTP Gateway Service](#deploy-your-xmtp-gateway-service). |
13239 | 13228 |
|
13240 | 13229 | ### For agents and Node.js apps |
13241 | 13230 |
|
@@ -13403,7 +13392,7 @@ This identity will then be used for rate limiting, and will be passed to your `A |
13403 | 13392 |
|
13404 | 13393 | :::code-group |
13405 | 13394 |
|
13406 | | -```go [IP Address] |
| 13395 | +```go [IP address] |
13407 | 13396 | // We provide a simple implementation that uses the client's IP address to identify users. For a production application, you should limit requests to only users actually authenticated in your application. |
13408 | 13397 | package main |
13409 | 13398 |
|
@@ -13521,7 +13510,7 @@ func main() { |
13521 | 13510 |
|
13522 | 13511 | ``` |
13523 | 13512 |
|
13524 | | -```go [Rate Limiting] |
| 13513 | +```go [Rate limiting] |
13525 | 13514 | package main |
13526 | 13515 |
|
13527 | 13516 | import ( |
@@ -13606,22 +13595,39 @@ func main() { |
13606 | 13595 |
|
13607 | 13596 | ## Deploy your XMTP Gateway Service |
13608 | 13597 |
|
13609 | | -Deploy the XMTP Gateway Service on your infrastructure of choice, such as a container hosting service ($25-50/month minimum). |
| 13598 | +:::tip[Example repo] |
13610 | 13599 |
|
13611 | | -We provide a Docker image that corresponds to the bare bones example above that you can run with the appropriate environment variables set in any hosting provider that supports Docker. |
| 13600 | +You can start with the [example gateway service repository](https://github.com/xmtp/gateway-service-example). |
13612 | 13601 |
|
13613 | | -```bash [Bash] |
13614 | | -docker run -p 5050:5050 -p 5055:5055 -e XMTPD_PAYER_PRIVATE_KEY=... xmtp/xmtpd-gateway:main |
13615 | | -``` |
| 13602 | +::: |
| 13603 | + |
| 13604 | +1. Fork or clone the repository. |
| 13605 | +2. Add your own authentication logic. |
| 13606 | +3. Configure your rate limits |
| 13607 | +4. Deploy your custom image on your infrastructure of choice, such as a container hosting service ($25-50/month minimum). |
13616 | 13608 |
|
13617 | | -Most production apps will require some level of customization to authorize user requests. You can fork our [example repository](https://github.com/xmtp/gateway-service-example), which includes a Dockerfile and a sample configuration. |
| 13609 | +#### Additional recommendations |
13618 | 13610 |
|
13619 | 13611 | The system is able to run without any external dependencies, but we recommend configuring a Redis instance to use for nonce management and rate limiting. |
13620 | 13612 |
|
13621 | 13613 | If your XMTP Gateway Service goes down, messages will queue until it comes back online. Build redundancy, if needed. |
13622 | 13614 |
|
13623 | 13615 | ## Test your XMTP Gateway Service |
13624 | 13616 |
|
| 13617 | +You can use the prebuilt Docker image for local development and testing: |
| 13618 | + |
| 13619 | +```bash [Bash] |
| 13620 | +docker run -p 5050:5050 -p 5055:5055 -e XMTPD_PAYER_PRIVATE_KEY=... xmtp/xmtpd-gateway:main |
| 13621 | +``` |
| 13622 | + |
| 13623 | +:::warning |
| 13624 | + |
| 13625 | +This pre-built image authorizes all requests without authentication. Never use it in production. |
| 13626 | + |
| 13627 | +::: |
| 13628 | + |
| 13629 | +### Test scenarios |
| 13630 | + |
13625 | 13631 | Here are some high priority scenarios to test: |
13626 | 13632 |
|
13627 | 13633 | - Deploy and test XMTP Gateway Service |
|
0 commit comments