Skip to content

Commit 3c3298d

Browse files
committed
Added README section
1 parent b310c11 commit 3c3298d

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,33 @@ You can also force streaming mode for any endpoint using the `--stream` or `-s`
113113
xurl -s /2/users/me
114114
```
115115

116+
### Temporary Webhook Setup
117+
118+
`xurl` can help you quickly set up a temporary webhook URL to receive events from the X API. This is useful for development and testing.
119+
120+
1. **Start the local webhook server with ngrok:**
121+
122+
Run the `webhook start` command. This will start a local server and use ngrok to create a public URL that forwards to your local server. You will be prompted for your ngrok authtoken if it's not already configured via the `NGROK_AUTHTOKEN` environment variable.
123+
124+
```bash
125+
xurl webhook start
126+
# Or with a specific port and output file for POST bodies
127+
xurl webhook start -p 8081 -o webhook_events.log
128+
```
129+
130+
The command will output an ngrok URL (e.g., `https://your-unique-id.ngrok-free.app/webhook`). Note this URL.
131+
132+
2. **Register the webhook with the X API:**
133+
134+
Use the ngrok URL obtained in the previous step to register your webhook. You'll typically use app authentication for this.
135+
136+
```bash
137+
# Replace https://your-ngrok-url.ngrok-free.app/webhook with the actual URL from the previous step
138+
xurl --auth app /2/webhooks -d '{"url": "<your ngrok url>"}' -X POST
139+
```
140+
141+
Your local `xurl webhook start` server will then handle the CRC handshake from Twitter and log incoming POST events (and write them to a file if `-o` was used).
142+
116143
### Media Upload
117144
118145
The tool supports uploading media files to the X API using the chunked upload process.

0 commit comments

Comments
 (0)