### Quick command example Source: https://instatunnel.my/docs?section=mcp-usage Quick command to authenticate and start a tunnel with a custom subdomain. ```shell `instatunnel auth login -e you@example.com && instatunnel 3000 --subdomain docs-demo` ``` -------------------------------- ### Install and Verify via NPM Source: https://instatunnel.my/docs?section=installation The recommended way to install InstaTunnel globally using NPM, verify the version, and start a tunnel. ```bash npm install -g instatunnel@latest ``` ```bash instatunnel --version ``` ```bash npm install -g instatunnel@latest ``` ```bash instatunnel 3000 ``` -------------------------------- ### Copy-ready command pack for instatunnel webhook setup Source: https://instatunnel.my/docs/troubleshooting A set of commands to install instatunnel, run diagnostics, initialize, verify, and test a Stripe webhook. Use these commands in sequence to set up and validate webhook integration. ```bash npm install -g instatunnel@latest instatunnel doctor --mcp instatunnel webhook init --provider stripe --port 3000 --path /webhooks/stripe instatunnel webhook verify --provider stripe --secret-env STRIPE_WEBHOOK_SECRET instatunnel webhook test --provider stripe ``` -------------------------------- ### Install InstaTunnel globally via npm Source: https://instatunnel.my/docs?section=getting-started Installs the InstaTunnel CLI globally using npm. This is the recommended installation method. ```bash $ npm install -g instatunnel ``` -------------------------------- ### Verify Installation and View Help Source: https://instatunnel.my/docs?section=installation Commands to verify the installed CLI version, view available commands, and test the tunnel functionality. ```bash instatunnel --version ``` ```bash instatunnel --help ``` ```bash instatunnel 3000 ``` -------------------------------- ### Shopify CLI trigger example Source: https://instatunnel.my/docs/webhooks/shopify Sends a test webhook event for the orders/create topic using the Shopify CLI. Event names may vary by app setup. ```bash # Shopify CLI example (event names vary by app setup) shopify app webhook trigger --topic orders/create ``` -------------------------------- ### Start a simple HTTP server Source: https://instatunnel.my/docs?section=first-tunnel Starts a local HTTP server on port 3000 using Python's built-in module. The output confirms the server is running on 0.0.0.0 port 3000. ```bash # Example: Start a simple HTTP server $ python -m http.server 3000 Serving HTTP on 0.0.0.0 port 3000... ``` -------------------------------- ### Download and Run Binary Source: https://instatunnel.my/docs?section=installation Manually download the Linux amd64 binary, set execution permissions, and start a tunnel on port 3000. ```bash curl -L https://api.instatunnel.my/releases/instatunnel-linux-amd64 -o instatunnel ``` ```bash chmod +x instatunnel ``` ```bash ./instatunnel 3000 ``` -------------------------------- ### One-Click Webhook Setup Helper commands Source: https://instatunnel.my/docs/webhooks/github Generate copy-ready tunnel command and webhook URL for the GitHub provider. ```bash instatunnel 3000 --subdomain github-dev ``` ```text https://github-dev.instatunnel.my/webhooks/github ``` -------------------------------- ### CLI helper commands for GitHub webhooks Source: https://instatunnel.my/docs/webhooks/github Use these commands first to avoid setup mistakes. They initialize, verify, and test the webhook with the GitHub provider. ```bash instatunnel webhook init --provider github --port 3000 --path /webhooks/github ``` ```bash instatunnel webhook verify --provider github --secret-env GITHUB_WEBHOOK_SECRET ``` ```bash instatunnel webhook test --provider github ``` -------------------------------- ### Initialize Shopify webhook CLI helper Source: https://instatunnel.my/docs/webhooks/shopify Run this first to set up the Shopify webhook endpoint locally. It avoids common setup mistakes before following the full provider steps. ```bash instatunnel webhook init --provider shopify --port 3000 --path /webhooks/shopify ``` -------------------------------- ### Expose React app with InstaTunnel Source: https://instatunnel.my/docs?section=frameworks Start a React development server and expose it with InstaTunnel. The first command starts the app, the second creates a tunnel on port 3000, and the third uses auto-detection. React development servers typically run on port 3000. ```bash # Start your React app $ npm start # In another terminal $ instatunnel 3000 # Or use auto-detection $ instatunnel ``` -------------------------------- ### Start MCP tunnel with v2 transport and subdomain Source: https://instatunnel.my/docs?section=mcp-usage Starts an MCP tunnel with Streamable HTTP transport v2 and a custom subdomain. Start your local MCP server first, then run this command. ```bash instatunnel 8787 --mcp --transport v2 --subdomain YOUR-SUBDOMAIN ``` -------------------------------- ### Team QA tunnel with --auth, --qr, --share, and --kill Source: https://instatunnel.my/docs/cli-flags Start a protected tunnel for team QA or demos with subdomain acme-qa, password auth qa:review2026, and a QR code. Use instatunnel --share to get copy-ready announcement text, and instatunnel --kill acme-qa to stop the tunnel. Password protection and Basic Auth require Pro or Business. ```bash instatunnel 3000 --subdomain acme-qa --auth qa:review2026 --qr ``` ```bash instatunnel --share ``` ```bash instatunnel --kill acme-qa ``` -------------------------------- ### Login via CLI to get API key Source: https://instatunnel.my/docs?section=authentication-api Run instatunnel login and enter your email and password. On success, the CLI displays your API key. ```bash $ instatunnel login 📧 Email: user@example.com 🔒 Password: ******** ✅ Login successful 🔑 API Key: it_1234567890abcdef ``` -------------------------------- ### Quick path: CLI helper commands for Twilio webhooks Source: https://instatunnel.my/docs/webhooks/twilio Quick-start CLI commands to initialize, verify, and test Twilio webhooks. Use these first to avoid setup mistakes, then follow the full provider steps below. ```bash instatunnel webhook init --provider twilio --port 3000 --path /webhooks/twilio/sms ``` ```bash instatunnel webhook verify --provider twilio --secret-env TWILIO_AUTH_TOKEN ``` ```bash instatunnel webhook test --provider twilio ``` -------------------------------- ### InstaTunnel CLI Flags Reference Examples Source: https://instatunnel.my/docs/cli-flags Examples of InstaTunnel CLI flags for customizing tunnels, authentication, and management. Each command shows a flag with its purpose, such as setting a subdomain, domain, region, password, auth, QR code, MCP mode, transport, request timeout, listing, killing, logs, stats, framework shortcuts, showing API key, and sharing templates. ```bash instatunnel 3000 -s myapp ``` ```bash instatunnel 3000 -d app.example.com ``` ```bash instatunnel 3000 -r us ``` ```bash instatunnel 3000 --password demo123 ``` ```bash instatunnel 3000 --auth user:pass ``` ```bash instatunnel 3000 --qr ``` ```bash instatunnel 8787 --mcp ``` ```bash instatunnel 8787 --mcp --transport v2 ``` ```bash instatunnel 3000 --request-timeout 2m ``` ```bash instatunnel --list ``` ```bash instatunnel --kill myapp ``` ```bash instatunnel --logs ``` ```bash instatunnel --stats ``` ```bash instatunnel --react ``` ```bash instatunnel auth show-key --reveal --copy ``` ```bash instatunnel --share ``` -------------------------------- ### Quick path: CLI helper commands Source: https://instatunnel.my/docs/webhooks/stripe Quick helper commands to initialize, verify, and test Stripe webhooks. Use these first to avoid setup mistakes, then follow the full provider steps. ```bash instatunnel webhook init --provider stripe --port 4242 --path /webhooks/stripe ``` ```bash instatunnel webhook verify --provider stripe --secret-env STRIPE_WEBHOOK_SECRET ``` ```bash instatunnel webhook test --provider stripe ``` -------------------------------- ### Get a new API key Source: https://instatunnel.my/docs?section=troubleshooting Login to instatunnel and open the dashboard to get a new API key. Use these commands when you encounter an invalid or expired API key error. ```bash $ instatunnel login ``` ```bash $ open https://dashboard.instatunnel.my/api-keys ``` -------------------------------- ### Comprehensive monitoring setup with instatunnel Source: https://instatunnel.my/docs?section=deployment Run a tunnel with detailed analytics, alerting thresholds, and Datadog integration. Requires the DATADOG_API_KEY environment variable to be set. ```bash instatunnel 3000 --subdomain myapp-prod \ --analytics detailed \ --alert-webhook https://alerts.myapp.com/tunnel \ --alert-requests 1000/hour \ --alert-errors 10/hour \ --alert-latency 2000ms \ --datadog-api-key $DATADOG_API_KEY ``` -------------------------------- ### Install, verify, and update InstaTunnel CLI Source: https://instatunnel.my/docs/cli-flags Install InstaTunnel globally, check the installed version, update to the latest version, and view the latest available version. CLI 1.1.24 or newer is required for anonymous tunnels; if creation returns 426 Upgrade Required, run the npm update command and restart the CLI. ```bash npm install -g instatunnel ``` ```bash instatunnel --version ``` ```bash npm install -g instatunnel@latest ``` ```bash npm view instatunnel version ``` -------------------------------- ### Connect local application to custom domain Source: https://instatunnel.my/docs?section=custom-domains After verifying the custom domain, connect your local application on port 3000 to the domain. SSL setup begins automatically after verification. ```bash instatunnel connect 3000 --domain app.example.com ``` -------------------------------- ### One-Click Webhook Setup Helper: tunnel command and webhook URL Source: https://instatunnel.my/docs/webhooks/stripe One-click webhook setup helper output: the tunnel command and the resulting webhook URL. Use these values to configure the Stripe dashboard endpoint. ```bash instatunnel 3000 --subdomain stripe-dev ``` ```text https://stripe-dev.instatunnel.my/webhooks/stripe ``` -------------------------------- ### Start MCP tunnel with streaming transport v2 Source: https://instatunnel.my/docs?section=mcp-usage Starts an MCP tunnel using the v2 transport for streaming behavior. Requires CLI version 1.1.7 or later. Optionally specify a subdomain. ```bash $ instatunnel 8787 --mcp --transport v2 ``` ```bash $ instatunnel 8787 --mcp --transport v2 --subdomain my-mcp ``` -------------------------------- ### Initialize PayPal webhook with InstaTunnel CLI Source: https://instatunnel.my/docs/webhooks/paypal Use this command to initialize a PayPal webhook tunnel on port 3000 with the path /webhooks/paypal. This is the first step to avoid setup mistakes. ```bash instatunnel webhook init --provider paypal --port 3000 --path /webhooks/paypal ``` -------------------------------- ### POST /auth/login - Login with credentials Source: https://instatunnel.my/docs?section=authentication-api Authenticate with email and password to get an API key. The response contains the API key and user details. ```bash curl -X POST \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","password":"mypassword"}' \ https://api.instatunnel.my/v1/auth/login ``` ```json // Response { "api_key": "it_1234567890abcdef", "user": { "id": "user_456", "email": "user@example.com", "name": "John Doe" } } ``` -------------------------------- ### Test PayPal webhook with CLI Source: https://instatunnel.my/docs/webhooks/paypal Use this command to test the PayPal webhook. It is a quick helper to avoid setup mistakes. ```bash instatunnel webhook test --provider paypal ``` -------------------------------- ### View live request logs Source: https://instatunnel.my/docs?section=basic-usage Start a tunnel and view live request logs. Requires an active tunnel. ```bash $ instatunnel 3000 ✅ Tunnel created: https://abc123.instatunnel.my 📊 Live requests will appear here automatically... ``` -------------------------------- ### Set API key correctly Source: https://instatunnel.my/docs?section=troubleshooting Set the API key either via environment variable or config file. Replace the example key with your actual key. ```bash $ export INSTATUNNEL_API_KEY="it_1234567890abcdef" ``` ```bash $ instatunnel config set api_key it_1234567890abcdef ``` -------------------------------- ### Check local server reachability for tunnel URL Source: https://instatunnel.my/docs/troubleshooting Run these commands to check if the local server is running on the correct port. Start the local app first, then run instatunnel with the correct port. ```bash curl http://localhost:8787 instatunnel doctor --port 8787 ``` -------------------------------- ### Auto-detect running application Source: https://instatunnel.my/docs?section=basic-usage Run `instatunnel` or `it` to automatically detect the running application on port 3000 and create a tunnel. This is the recommended and easiest way to start a tunnel. ```bash $ instatunnel 🔍 Auto-detected service on port 3000 ✅ Tunnel created: https://abc123.instatunnel.my ``` ```bash $ it 🔍 Auto-detected service on port 3000 ✅ Tunnel created: https://def456.instatunnel.my ``` -------------------------------- ### Example API request with Bearer token Source: https://instatunnel.my/docs?section=authentication-api Use this curl command to make an authenticated API request. Replace YOUR_API_KEY with your actual API key. ```bash curl -H "Authorization: Bearer it_1234567890abcdef" \ https://api.instatunnel.my/v1/tunnels ``` -------------------------------- ### Expose Angular app with InstaTunnel Source: https://instatunnel.my/docs?section=frameworks Start an Angular development server and expose it with InstaTunnel. Angular CLI serves on port 4200. Useful for sharing prototypes and testing PWA features. ```bash # Start Angular development server $ ng serve # Expose to internet $ instatunnel 4200 ``` -------------------------------- ### Package.json Scripts for InstaTunnel Source: https://instatunnel.my/docs?section=frameworks Add InstaTunnel to your npm scripts for quick access. Includes scripts for running the tunnel, using a named subdomain, and starting both dev server and tunnel concurrently. ```json { "scripts": { "dev": "next dev", "tunnel": "instatunnel 3000", "tunnel:named": "instatunnel 3000 --subdomain my-project", "dev:shared": "concurrently \"npm run dev\" \"npm run tunnel\"" } } ``` ```bash # Usage $ npm run tunnel $ npm run tunnel:named $ npm run dev:shared # Starts dev server AND tunnel ``` -------------------------------- ### Start HTTP tunnel for webhook testing Source: https://instatunnel.my/docs?section=mcp-usage Generic webhook testing with a normal HTTP tunnel on port 3000 and a custom subdomain. Use this for localhost sharing and webhook testing, not for MCP tools. ```bash instatunnel 3000 --subdomain webhook-demo ``` -------------------------------- ### Jekyll Development Server and Tunnel Commands Source: https://instatunnel.my/docs?section=frameworks Start the Jekyll development server with jekyll serve, then create a tunnel with instatunnel on port 4000. Useful for GitHub Pages development and blog previews. ```bash $ jekyll serve # Usually port 4000 $ instatunnel 4000 ``` -------------------------------- ### Start MCP tunnel with v1 or v2 transport Source: https://instatunnel.my/docs/cli-flags Start an MCP tunnel: use default v1 for most compatibility, or switch to v2 for streaming MCP clients. v2 requires CLI 1.1.7+; update with npm install -g instatunnel@latest. Use endpoint https://dev-mcp-demo.instatunnel.my/mcp. ```bash instatunnel 8787 --mcp --subdomain dev-mcp-demo ``` ```bash instatunnel 8787 --mcp --transport v2 --subdomain dev-mcp-demo ``` -------------------------------- ### Hugo Development Server and Tunnel Commands Source: https://instatunnel.my/docs?section=frameworks Start the Hugo development server with hugo server, then create a tunnel with instatunnel on port 1313. Useful for fast static site sharing and content preview. ```bash $ hugo server # Usually port 1313 $ instatunnel 1313 ``` -------------------------------- ### MCP Endpoint with Streaming Setup Source: https://instatunnel.my/docs/cli-flags MCP endpoint with streaming: set API key, verify it, then start an MCP tunnel on port 8787 with transport v2 and subdomain 'mcp-demo'. ```bash instatunnel auth set-key "it_your_api_key" ``` ```bash instatunnel auth show-key ``` ```bash instatunnel 8787 --mcp --transport v2 -s mcp-demo ``` -------------------------------- ### Local app setup: Express + Stripe webhook endpoint Source: https://instatunnel.my/docs/webhooks/stripe Local Express app that creates a webhook endpoint at `/webhooks/stripe`. Uses `express.raw` to get the raw body for signature verification and `stripe.webhooks.constructEvent` to validate the `stripe-signature` header. ```javascript import express from 'express' import Stripe from 'stripe' const app = express() const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!) app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), (req, res) => { const sig = req.header('stripe-signature') || '' try { const event = stripe.webhooks.constructEvent( req.body, sig, process.env.STRIPE_WEBHOOK_SECRET! ) console.log('stripe event:', event.type) res.status(200).send('ok') } catch (err) { console.error('invalid signature', err) res.status(400).send('invalid signature') } }) app.listen(3000, () => console.log('listening on :3000')) ``` -------------------------------- ### GET /auth/user - Get user info Source: https://instatunnel.my/docs?section=authentication-api Retrieve information about the authenticated user. Replace YOUR_API_KEY with your actual API key. ```bash curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.instatunnel.my/v1/auth/user ``` ```json // Response { "id": "user_456", "email": "user@example.com", "name": "John Doe", "plan": "pro", "created_at": "2024-01-15T10:30:00Z", "usage": { "tunnels_created": 156, "data_transferred": "2.4 GB", "requests_served": 12487 } } ``` -------------------------------- ### MCP user flow for new users Source: https://instatunnel.my/docs/cli-flags For new users: log in with email, verify email and copy API key from the verification page, then save the key locally with auth set-key. ```bash instatunnel auth login -e you@example.com ``` ```bash instatunnel auth set-key "it_your_api_key" ``` -------------------------------- ### Show and copy API key with instatunnel auth show-key Source: https://instatunnel.my/docs?section=mcp-usage Displays the saved API key and copies it to the clipboard. Use --reveal to show the key and --copy to copy it. ```bash $ instatunnel auth show-key --reveal --copy ``` -------------------------------- ### Start MCP tunnel with v1 default transport Source: https://instatunnel.my/docs?section=mcp-usage Starts an MCP tunnel on port 8787 using the default v1 transport. Optionally specify a subdomain with --subdomain. ```bash $ instatunnel 8787 --mcp ``` ```bash $ instatunnel 8787 --mcp --subdomain my-mcp ``` -------------------------------- ### Global config file ~/.instatunnel.yaml Source: https://instatunnel.my/docs?section=configuration Create this file at ~/.instatunnel.yaml to set persistent global configuration. The file is automatically loaded if present in your home directory. ```yaml # ~/.instatunnel.yaml api_key: "your_api_key_here" server_url: "https://api.instatunnel.my" ``` -------------------------------- ### Auto-detect and share instantly Source: https://instatunnel.my/docs?section=basic-usage Run `it` to auto-detect the local server and share it instantly. ```bash $ it ``` -------------------------------- ### GET /auth/keys Source: https://instatunnel.my/docs?section=authentication-api Lists all API keys for your account. ```APIDOC ## GET /auth/keys ### Description List all API keys for your account. ### Method GET ### Endpoint https://api.instatunnel.my/v1/auth/keys ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token with your API key. ### Request Example No request example provided. ### Response No response body documented. ``` -------------------------------- ### Environment-specific configuration with NODE_ENV and INSTATUNNEL_CONFIG Source: https://instatunnel.my/docs?section=deployment Shows how to manage environment-specific configuration files. The first block lists the expected config files for development, staging, and production. The second block uses the NODE_ENV variable to select the appropriate config file with the --config flag. The third block demonstrates overriding the config with the INSTATUNNEL_CONFIG environment variable, where setting it to production makes instatunnel use the production config. ```yaml .instatunnel.development.yml .instatunnel.staging.yml .instatunnel.production.yml ``` ```bash $ instatunnel --config .instatunnel.$NODE_ENV.yml ``` ```bash $ export INSTATUNNEL_CONFIG=production $ instatunnel 3000 # Uses production config ``` -------------------------------- ### GET /tunnels Source: https://instatunnel.my/docs?section=rest-api Lists all active tunnels for the authenticated account. ```APIDOC ## GET /tunnels ### Description List all active tunnels for your account. ### Method GET ### Endpoint https://api.instatunnel.my/api/tunnels ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token with your API key. ### Request Example ```bash curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.instatunnel.my/api/tunnels ``` ### Response #### Success Response (200) - **tunnels** (array) - List of active tunnels. #### Response Example ```json { "tunnels": [] } ``` ``` -------------------------------- ### Authenticate new user Source: https://instatunnel.my/docs?section=mcp-usage Authenticate with the CLI as a new user by providing email and password. ```shell $ instatunnel auth login -e you@example.com ``` -------------------------------- ### GET /v1/auth/keys Source: https://instatunnel.my/docs?section=authentication-api Lists all API keys associated with the authenticated account. ```APIDOC ## GET /v1/auth/keys ### Description Lists all API keys associated with the authenticated account. ### Method GET ### Endpoint https://api.instatunnel.my/v1/auth/keys ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token with your API key. ### Request Example ```bash curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.instatunnel.my/v1/auth/keys ``` ### Response #### Success Response (200) - **keys** (array) - List of API key objects. - **id** (string) - Unique identifier for the key. - **name** (string) - Human-readable name of the key. - **key** (string) - The key value (masked). - **created_at** (string) - Creation timestamp in ISO 8601 format. - **last_used** (string) - Last usage timestamp in ISO 8601 format. - **permissions** (array of strings) - Permissions granted to the key. #### Response Example ```json { "keys": [ { "id": "key_123", "name": "Production Key", "key": "it_***...def", "created_at": "2024-01-15T10:30:00Z", "last_used": "2024-07-02T14:30:00Z", "permissions": ["tunnels:read", "tunnels:write"] } ] } ``` ``` -------------------------------- ### Branch-based deployment with instatunnel Source: https://instatunnel.my/docs?section=deployment Creates a unique subdomain per Git branch for branch-based deployments. The BRANCH variable is captured from the current Git branch and used in the subdomain, resulting in URLs like https://myapp-dev.instatunnel.my for development, https://myapp-staging.instatunnel.my for staging, https://myapp-prod.instatunnel.my for production, and https://myapp-feature-auth.instatunnel.my for feature branches. ```bash $ BRANCH=$(git branch --show-current) $ instatunnel 3000 --subdomain myapp-$BRANCH ``` -------------------------------- ### GET /v1/oauth/authorize Source: https://instatunnel.my/docs?section=authentication-api Redirects the user to the authorization URL to initiate the OAuth flow. ```APIDOC ## GET /v1/oauth/authorize ### Description Redirect ``` -------------------------------- ### GET /auth/user Source: https://instatunnel.my/docs?section=authentication-api Retrieves information about the currently authenticated user, including their plan and usage statistics. ```APIDOC ## GET /auth/user ### Description Get current user information. ### Method GET ### Endpoint https://api.instatunnel.my/v1/auth/user ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token with your API key. ### Request Example ```bash curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.instatunnel.my/v1/auth/user ``` ### Response #### Success Response (200) - **id** (string) - User ID. - **email** (string) - User email. - **name** (string) - User name. - **plan** (string) - Subscription plan. - **created_at** (string) - Account creation timestamp. - **usage** (object) - Usage statistics. - **tunnels_created** (number) - Number of tunnels created. - **data_transferred** (string) - Amount of data transferred. - **requests_served** (number) - Number of requests served. #### Response Example ```json { "id": "user_456", "email": "user@example.com", "name": "John Doe", "plan": "pro", "created_at": "2024-01-15T10:30:00Z", "usage": { "tunnels_created": 156, "data_transferred": "2.4 GB", "requests_served": 12487 } } ``` ``` -------------------------------- ### GET /api/analytics/tunnel/:id?days=7 Source: https://instatunnel.my/docs?section=analytics Retrieves analytics for a specific tunnel. Requires a Pro plan. ```APIDOC ## GET /api/analytics/tunnel/:id?days=7 ### Description Retrieves analytics for a specific tunnel. Requires a Pro plan. ### Method GET ### Endpoint /api/analytics/tunnel/:id?days=7 ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the tunnel. #### Query Parameters - **days** (integer) - Optional - Number of days for the analytics period (1-365). Default is 7. ### Request Example ``` GET /api/analytics/tunnel/123?days=7 Authorization: Bearer YOUR_API_KEY ``` ### Response #### Success Response (200) - **tunnel_id** (integer) - The tunnel ID. - **message** (string) - Message indicating upgrade requirement if not Pro. #### Response Example (Free user) ``` { "tunnel_id": 123, "message": "Upgrade to Pro for detailed analytics" } ``` ``` -------------------------------- ### Jenkinsfile for InstaTunnel preview deployment Source: https://instatunnel.my/docs?section=deployment Jenkins pipeline that builds the project and deploys a preview for each change request to a unique subdomain. Requires an INSTATUNNEL_API_KEY environment variable. The preview URL is https://pr-.instatunnel.my. ```groovy // Jenkinsfile pipeline { agent any stages { stage('Build') { steps { sh 'npm install' sh 'npm run build' } } stage('Deploy Preview') { when { changeRequest() } steps { sh 'npm install -g instatunnel' sh 'npm start &' sh 'sleep 10' sh "instatunnel 3000 --subdomain pr-${env.CHANGE_ID} --background" } } } } ``` -------------------------------- ### GET /api/analytics/tunnel/:id/requests?limit=100 Source: https://instatunnel.my/docs?section=analytics Retrieves request logs for a specific tunnel. Requires a Pro plan. ```APIDOC ## GET /api/analytics/tunnel/:id/requests?limit=100 ### Description Retrieves request logs for a specific tunnel. Requires a Pro plan. ### Method GET ### Endpoint /api/analytics/tunnel/:id/requests?limit=100 ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the tunnel. #### Query Parameters - **limit** (integer) - Optional - Maximum number of request logs to return. Default is 100. ### Request Example ``` GET /api/analytics/tunnel/123/requests?limit=100 Authorization: Bearer YOUR_API_KEY ``` ### Response #### Success Response (200) - **tunnel_id** (integer) - The tunnel ID. - **message** (string) - Message indicating upgrade requirement if not Pro. #### Response Example (Free user) ``` { "tunnel_id": 123, "message": "Upgrade to Pro for detailed analytics" } ``` ``` -------------------------------- ### GET /api/analytics/summary?days=7 Source: https://instatunnel.my/docs?section=analytics Retrieves a summary of user analytics for the specified period. Available to all authenticated users. ```APIDOC ## GET /api/analytics/summary?days=7 ### Description Retrieves a summary of user analytics for the specified period. Available to all authenticated users. ### Method GET ### Endpoint /api/analytics/summary?days=7 ### Parameters #### Query Parameters - **days** (integer) - Optional - Number of days for the analytics period (1-365). Default is 7. ### Request Example ``` GET /api/analytics/summary?days=7 Authorization: Bearer YOUR_API_KEY ``` ### Response #### Success Response (200) - **user_id** (integer) - The user's ID. - **period_days** (integer) - The number of days in the analytics period. - **total_requests** (integer) - Total number of requests. - **total_tunnels** (integer) - Total number of tunnels. - **unique_visitors** (integer) - Number of unique visitors. #### Response Example ``` { "user_id": 123, "period_days": 7, "total_requests": 1247, "total_tunnels": 5, "unique_visitors": 23 } ``` ### Error Responses #### Unauthorized Access (401) - **error** (string) - Error message. #### Error Example ``` {"error": "User not found in context"} ``` ``` -------------------------------- ### Use the ultra-short alias 'it' Source: https://instatunnel.my/docs?section=getting-started Runs the ultra-short alias 'it' to auto-detect and expose your app. The output shows the detected port and the generated tunnel URL. ```bash $ it 🔍 Auto-detected service on port 3000 ✅ Tunnel created: https://def456.instatunnel.my ``` -------------------------------- ### Verify API key with config show and auth test Source: https://instatunnel.my/docs?section=troubleshooting Verify the API key format and test authentication. ```bash $ instatunnel config show ``` ```bash $ instatunnel auth test ``` -------------------------------- ### Register and create tunnel with account Source: https://instatunnel.my/docs?section=authentication Registers a new account with an email, saves the API key to config, and sends a verification email. Then creates a tunnel with a custom subdomain. Requires CLI v1.1.24 or newer. ```bash # Register with your email $ instatunnel auth login --email your@email.com ✅ Registration successful! 🔑 API key saved to config 📧 Verification email sent # Now you can use enhanced features $ instatunnel 3000 --subdomain myapp ✅ Tunnel created: https://myapp.instatunnel.my ``` -------------------------------- ### PayPal webhook URL from helper Source: https://instatunnel.my/docs/webhooks/paypal The webhook URL generated by the One-Click Webhook Setup Helper for the paypal-dev subdomain. ```text https://paypal-dev.instatunnel.my/webhooks/paypal ``` -------------------------------- ### Enable compression and increase connections Source: https://instatunnel.my/docs?section=troubleshooting Enable compression and increase the number of connections to improve performance. ```bash $ instatunnel 3000 --compress --connections 10 ``` -------------------------------- ### Get tunnel-specific analytics (Pro required) Source: https://instatunnel.my/docs?section=analytics Fetches tunnel-specific analytics for tunnel ID 123. Requires a Pro plan. ```bash curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.instatunnel.my/api/analytics/tunnel/123?days=7 ``` -------------------------------- ### Auto-detect and expose your app instantly Source: https://instatunnel.my/docs?section=getting-started Runs InstaTunnel with no arguments to auto-detect a running service on port 3000 and create a tunnel. The output shows the detected port and the generated tunnel URL. ```bash $ instatunnel 🔍 Auto-detected service on port 3000 ✅ Tunnel created: https://abc123.instatunnel.my 📋 URL copied to clipboard! ``` -------------------------------- ### High availability setup with multiple instances, health checks, and PM2 Source: https://instatunnel.my/docs?section=deployment High availability setup for production. The first block runs two tunnel instances in different regions (us-east and us-west) with auto-restart for redundancy. The second block configures health checks on /health every 30 seconds and sends alerts to a webhook. The third block manages the tunnel process with PM2, naming it 'tunnel'. ```bash $ instatunnel 3000 --subdomain myapp --region us-east --auto-restart & $ instatunnel 3000 --subdomain myapp --region us-west --auto-restart & ``` ```bash $ instatunnel 3000 --health-check /health --health-interval 30s \ --alert-webhook https://monitoring.myapp.com/tunnel-alert ``` ```bash $ pm2 start "instatunnel 3000 --subdomain myapp-prod" --name tunnel ``` -------------------------------- ### Production security configuration with auth, IP whitelist, and logging Source: https://instatunnel.my/docs?section=deployment Production security configuration for instatunnel. Enables authentication with admin credentials, restricts access to a specific IP range, forces HTTPS, sets logging to info level with a log file, and alerts after 5 failed attempts. The checklist includes strong authentication, IP whitelisting, HTTPS enforcement, request logging, failed attempt monitoring, and regular credential rotation. ```bash $ instatunnel 3000 --subdomain myapp-prod \ --auth admin:$SECURE_PASSWORD \ --allow-ips 203.0.113.0/24 \ --force-https \ --log-level info \ --log-file /var/log/tunnel.log \ --alert-failed-attempts 5 ``` -------------------------------- ### Production performance tuning with instatunnel Source: https://instatunnel.my/docs?section=deployment Optimized production configuration for instatunnel with compression, connection pooling, keep-alive, timeout, region auto-selection, and warn log level. ```bash instatunnel 3000 --subdomain myapp-prod \ --compress \ --connections 20 \ --keep-alive 60s \ --timeout 120s \ --region auto \ --log-level warn ``` -------------------------------- ### Get tunnel request logs (Pro required) Source: https://instatunnel.my/docs?section=analytics Retrieves request logs for tunnel ID 123. Requires a Pro plan. ```bash curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.instatunnel.my/api/analytics/tunnel/123/requests?limit=100 ``` -------------------------------- ### Enable HTTP basic authentication Source: https://instatunnel.my/docs?section=basic-usage Pro and Business accounts can use HTTP Basic Auth. Browsers show a login prompt; API clients can send credentials with `curl -u username:password`. ```bash $ instatunnel 3000 --auth username:password 🔐 Basic authentication enabled ✅ Tunnel created: https://abc123.instatunnel.my 🔐 Basic auth enabled (username/password required) ``` -------------------------------- ### Show API key with auth show-key and --reveal --copy Source: https://instatunnel.my/docs/cli-flags View the saved API key, masked by default. Use --reveal --copy to explicitly recover the key and copy it to the clipboard. ```bash auth show-key ``` ```bash auth show-key --reveal --copy ```