Skip to content

Authentication

Use a Tubu API key to publish tunnels or reserve domains.

The CLI uses the first credential supplied in the order below.

Command line flag

Pass --authtoken or -u to use an API key for this command.

npx tubu-cli http 3000 --domain my-app.tubu.dev --authtoken YOUR_API_KEY

Configuration file

When you run npx tubu-cli --config tubu.yml, the CLI reads authtoken at the root of the file.

authtoken: YOUR_API_KEY
tunnels:
  - type: http
    domain: my-app.tubu.dev
    target: 3000

Keep configuration files that contain API keys out of source control.

Environment variable

Set TUBU_TOKEN in the CLI environment.

TUBU_TOKEN=YOUR_API_KEY npx tubu-cli http 3000 --domain my-app.tubu.dev

A missing or invalid selected key causes an error. The CLI validates the YAML before applying a command line override, so correct or remove any invalid YAML authtoken value.

Caller access

To control who can connect to a published HTTP tunnel, set a separate shared secret. See Protect an HTTP tunnel.