Skip to main content
Create public URLs that allow external access to your services without requiring authentication. Perfect for webhooks, demos, and API sharing.

Usage

connect link [target] [options]

Basic Examples

Create Public URL for Existing Service

connect link my-api
# → https://abc123.privateconnect.co

Auto-Detect and Expose

If the service isn’t exposed yet, connect link will detect and expose it:
connect link localhost:3000
# → Detecting service on localhost:3000...
# → Exposing as "api"...
# → https://xyz789.privateconnect.co

Webhook Testing

# Start your local server
npm run dev

# Create public URL
connect link localhost:3000 --expires 2h
# → https://webhook-test.privateconnect.co

# Use in Stripe, GitHub, Twilio webhook settings

Options

target
string
Service name or target (e.g., my-api or localhost:3000)
--expires, -e
string
default:"24h"
Expiration duration: 1h, 24h, 7d, 30d, or never
--methods, -m
string
Allowed HTTP methods (comma-separated). Example: GET,POST
--paths, -p
string
Allowed paths (comma-separated). Example: /api,/health. Paths must start with /
--rate-limit, -r
number
Rate limit in requests per minute
--name, -n
string
Service name (auto-detected if not provided)
--hub, -H
string
default:"https://api.privateconnect.co"
Hub server URL
--config, -c
string
Config file path

Access Control Examples

Read-Only Access

connect link api --methods GET --expires 7d

Specific Paths Only

connect link api --paths /api/public,/health --expires 30d

Rate Limited

connect link api --rate-limit 100 --expires 24h
# Max 100 requests per minute

Combined Restrictions

connect link api \
  --methods GET,POST \
  --paths /api/v1 \
  --rate-limit 60 \
  --expires 7d

Use Cases

Webhook Development

Test Stripe, GitHub, Twilio webhooks against your local server

Open Source Contributions

Let contributors access your API without sharing credentials

Client Demos

Share work-in-progress with clients securely

API Sharing

Provide temporary API access to partners or contractors
Links are managed through the web dashboard or API. Use the API to list active links:
curl https://api.privateconnect.co/v1/shares \
  -H "x-api-key: your-api-key"
Revoke via API:
curl -X DELETE https://api.privateconnect.co/v1/shares/share_xxx \
  -H "x-api-key: your-api-key"

Security Best Practices

Public links bypass authentication. Use access controls to limit exposure.
Database ports (5432, 3306, 27017, 6379) cannot be made public for security.
Recommendations:
  1. Set expiration - Use short durations for temporary access
  2. Restrict methods - Limit to GET for read-only access
  3. Restrict paths - Only expose specific endpoints
  4. Add rate limits - Prevent abuse
  5. Monitor logs - Check access patterns in audit logs

How It Works

  1. Service Detection - If target is localhost:PORT, service is auto-exposed
  2. Link Creation - Public URL is generated with optional restrictions
  3. Reverse Proxy - Requests are proxied to your local service
  4. Access Control - Methods, paths, and rate limits are enforced
  5. Expiration - Link auto-expires after the specified duration

Exit Codes

  • 0 - Success
  • 1 - Error (service not found, network issue)
  • 2 - Invalid arguments

Build docs developers (and LLMs) love