How to print Replit dev URL programmatically?

Problem description:
I can no longer predict what the Replit Dev URL is going to be, making shared dev tools and sample projects more difficult to use.

Expected behavior: === dev endpoint.

Actual behavior:

An unpredictable URL with parts that are not possible to figure out based on ENV vars alone. And no API to fetch it.

Steps to reproduce:
Try to print the URL to console.

This is big downgrade to dev experience for people who used tools that appended path info and tokens to the URL in the console.


This is intentional, it’s designed to make the URLs harder to share/remember. Also, they will change every so often.

Most of it is actually in env vars, except for a small segment in the middle of the URL.


These URLs change ~1 time per year, so you could copy the URL and put it into a Secret (which is what I do), but maybe there’s a better solution here :slight_smile:


What is the small segment in the middle of the URL?

Example URLs that I would really like working again:

  • Vite Remote URL console printout
  • Slidev link
  • SSO server debugging links
  • Replit Multiport URLs… Running a client and a server on different ports now requires manual configuration… rendering Starter projects like Feather-chat a much bigger hassel.
  • NPM packages that integrate server packages with client-side packages… now require additional Replit specific manual configuration, when they used to be one-click
  • Countless other situations where code expects the server to know the remote endpoint
  • E2E testing with SSL dependent Web APIs

Also why are these so crazy long? It hurts DX for web developers… The primary reason to use Replit is hypothetically improved DX…

1 Like

Using your URL above:


:person_shrugging: This is the part not in env vars


That’s going off memory, there’s a topic about it here somewhere.

EDIT: Found the topic I was looking for: