queuebear 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -219,10 +219,9 @@ export const POST = serve<InputType>(async (context) => {
|
|
|
219
219
|
|
|
220
220
|
**Options:**
|
|
221
221
|
|
|
222
|
-
| Option | Type | Description
|
|
223
|
-
| --------------- | -------- |
|
|
224
|
-
| `signingSecret` | `string` | Secret to verify requests come from QueueBear
|
|
225
|
-
| `baseUrl` | `string` | Override QueueBear base URL (auto-detected if not set) |
|
|
222
|
+
| Option | Type | Description |
|
|
223
|
+
| --------------- | -------- | --------------------------------------------- |
|
|
224
|
+
| `signingSecret` | `string` | Secret to verify requests come from QueueBear |
|
|
226
225
|
|
|
227
226
|
### Framework Integration
|
|
228
227
|
|
|
@@ -492,6 +491,76 @@ The signing secret is available in your QueueBear project settings. When configu
|
|
|
492
491
|
|
|
493
492
|
---
|
|
494
493
|
|
|
494
|
+
## Local Development
|
|
495
|
+
|
|
496
|
+
When developing locally, your webhook endpoints run on `localhost` which isn't accessible from QueueBear's servers. Use a tunnel service to expose your local server.
|
|
497
|
+
|
|
498
|
+
### Using ngrok (Recommended)
|
|
499
|
+
|
|
500
|
+
[ngrok](https://ngrok.com) provides stable URLs and a built-in request inspector.
|
|
501
|
+
|
|
502
|
+
**1. Install and authenticate:**
|
|
503
|
+
|
|
504
|
+
```bash
|
|
505
|
+
# Install
|
|
506
|
+
brew install ngrok # or download from ngrok.com/download
|
|
507
|
+
|
|
508
|
+
# Authenticate (free account required)
|
|
509
|
+
ngrok config add-authtoken YOUR_AUTH_TOKEN
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
**2. Start the tunnel:**
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
ngrok http 3000
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
**3. Use the forwarding URL:**
|
|
519
|
+
|
|
520
|
+
```typescript
|
|
521
|
+
// Use ngrok URL instead of localhost
|
|
522
|
+
await qb.messages.publish("https://abc123.ngrok.io/api/webhooks", {
|
|
523
|
+
event: "user.created",
|
|
524
|
+
userId: "123"
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
// Works for workflows too
|
|
528
|
+
await qb.workflows.trigger(
|
|
529
|
+
"onboarding",
|
|
530
|
+
"https://abc123.ngrok.io/api/workflows/onboarding",
|
|
531
|
+
{ userId: "123" }
|
|
532
|
+
);
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
**Debugging:** ngrok provides a web inspector at `http://localhost:4040` to view requests, responses, and replay failed deliveries.
|
|
536
|
+
|
|
537
|
+
### Using localtunnel
|
|
538
|
+
|
|
539
|
+
[localtunnel](https://localtunnel.me) is free and requires no signup.
|
|
540
|
+
|
|
541
|
+
```bash
|
|
542
|
+
npx localtunnel --port 3000
|
|
543
|
+
# Output: your url is: https://good-months-leave.loca.lt
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
**Note:** localtunnel shows a reminder page on first visit. Bypass it by adding a header:
|
|
547
|
+
|
|
548
|
+
```typescript
|
|
549
|
+
await qb.messages.publish(
|
|
550
|
+
"https://good-months-leave.loca.lt/api/webhooks",
|
|
551
|
+
{ event: "test" },
|
|
552
|
+
{ headers: { "bypass-tunnel-reminder": "true" } }
|
|
553
|
+
);
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
### Tips
|
|
557
|
+
|
|
558
|
+
- Store your tunnel URL in `.env` for easy switching between local and production
|
|
559
|
+
- Both `callbackUrl` and `failureCallbackUrl` need public URLs for local testing
|
|
560
|
+
- ngrok URLs change on restart (stable URLs require a paid plan)
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
495
564
|
## License
|
|
496
565
|
|
|
497
566
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "queuebear",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "QueueBear SDK for message queues, scheduled jobs, and durable workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"author": {
|
|
44
44
|
"name": "Robert Marshall",
|
|
45
|
-
"email": "
|
|
45
|
+
"email": "hello@robertmarshall.dev",
|
|
46
46
|
"url": "https://robertmarshall.dev"
|
|
47
47
|
},
|
|
48
48
|
"license": "MIT",
|