# Using a token

> Get reusable, named public URLs by configuring a server token.

Tokens authorize reusable public names. For the hosted service, clients connect
to `https://edge.routeup.dev` and receive a namespace under `routeup.dev`.

You only need a token for reusable named public URLs such as
`https://example-app.your-name.routeup.dev`. Local-only routes do not need one.
The public address can be claimed again between runs, but it is reachable only
while a tunnel is connected.

## Request a hosted token

Hosted tokens are currently issued manually. Email
[tokens@routeup.dev](mailto:tokens@routeup.dev?subject=Routeup%20hosted%20token%20request&body=Preferred%20namespace%3A%0AWhat%20you%20are%20building%3A%0A)
with:

- the namespace you would like, such as `your-name.routeup.dev`, and
- a short note about what you are building.

The token will be returned privately. Store it in a password manager: the
server keeps only its hash and cannot show the secret again.

## Save a server and token

```bash
routeup setup --server https://edge.routeup.dev --token sk_routeup_xxx
```

After that, `routeup serve --expose` can use the saved values.

On an interactive re-run, setup represents the saved token with a masked value.
Press Enter to keep it,
or clear credentials explicitly:

```bash
routeup setup --token none   # keep the server, clear only the token
routeup setup --server none  # clear both
```

## Use environment variables instead

```bash
export ROUTEUP_SERVER=https://edge.routeup.dev
export ROUTEUP_TOKEN=sk_routeup_xxx
```

## Expose with the token

```bash
routeup serve example-app --port 8080 --expose
```

If the token allows `*.team.routeup.dev`, the server can grant:

```txt
https://example-app.team.routeup.dev
```

The token secret is not recoverable from the server after it is created.

## Without a token

For token-less temporary URLs, see
[Exposing publicly](/docs/getting-started/exposing-publicly#token-less-random-names).
