queuebear 0.1.8 → 0.1.9
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 +17 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -493,33 +493,34 @@ The signing secret is available in your QueueBear project settings. When configu
|
|
|
493
493
|
|
|
494
494
|
## Local Development
|
|
495
495
|
|
|
496
|
-
When developing locally, your webhook endpoints run on `localhost` which isn't accessible from QueueBear's servers. Use
|
|
496
|
+
When developing locally, your webhook endpoints run on `localhost` which isn't accessible from QueueBear's servers. Use [Tunnelmole](https://tunnelmole.com) to expose your local server - it's free and requires no signup.
|
|
497
497
|
|
|
498
|
-
###
|
|
498
|
+
### Installing Tunnelmole
|
|
499
499
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
**1. Install and authenticate:**
|
|
500
|
+
**Linux, macOS, Windows WSL:**
|
|
503
501
|
|
|
504
502
|
```bash
|
|
505
|
-
|
|
506
|
-
|
|
503
|
+
curl -O https://install.tunnelmole.com/t357g/install && sudo bash install
|
|
504
|
+
```
|
|
507
505
|
|
|
508
|
-
|
|
509
|
-
|
|
506
|
+
**Node.js (all platforms, requires Node 16+):**
|
|
507
|
+
|
|
508
|
+
```bash
|
|
509
|
+
npm install -g tunnelmole
|
|
510
510
|
```
|
|
511
511
|
|
|
512
|
-
|
|
512
|
+
### Starting a Tunnel
|
|
513
513
|
|
|
514
514
|
```bash
|
|
515
|
-
|
|
515
|
+
tmole 3000
|
|
516
|
+
# Output: https://xxxx.tunnelmole.com is forwarding to localhost:3000
|
|
516
517
|
```
|
|
517
518
|
|
|
518
|
-
|
|
519
|
+
### Using the Tunnel URL
|
|
519
520
|
|
|
520
521
|
```typescript
|
|
521
|
-
// Use
|
|
522
|
-
await qb.messages.publish("https://
|
|
522
|
+
// Use tunnelmole URL instead of localhost
|
|
523
|
+
await qb.messages.publish("https://xxxx.tunnelmole.com/api/webhooks", {
|
|
523
524
|
event: "user.created",
|
|
524
525
|
userId: "123"
|
|
525
526
|
});
|
|
@@ -527,37 +528,16 @@ await qb.messages.publish("https://abc123.ngrok.io/api/webhooks", {
|
|
|
527
528
|
// Works for workflows too
|
|
528
529
|
await qb.workflows.trigger(
|
|
529
530
|
"onboarding",
|
|
530
|
-
"https://
|
|
531
|
+
"https://xxxx.tunnelmole.com/api/workflows/onboarding",
|
|
531
532
|
{ userId: "123" }
|
|
532
533
|
);
|
|
533
534
|
```
|
|
534
535
|
|
|
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
536
|
### Tips
|
|
557
537
|
|
|
558
538
|
- Store your tunnel URL in `.env` for easy switching between local and production
|
|
559
539
|
- Both `callbackUrl` and `failureCallbackUrl` need public URLs for local testing
|
|
560
|
-
-
|
|
540
|
+
- Tunnel URLs change on restart
|
|
561
541
|
|
|
562
542
|
---
|
|
563
543
|
|