Tidewave IDE supports applications that run across multiple domains.

If you are using multiple hosts or subdomains during development, you must use a secure domain. This implies you must either:

  • Use *.localhost. For example, by running your application on localhost, you can access it at localhost:3000 and admin.localhost:3000 from most browsers (Safari being a notable exception)

  • Use https, in those cases, see our HTTPS guide

At the moment, a single Tidewave IDE session cannot navigate across domains, so if you are working on both domains above at the same time, you will need at least two browser tabs running Tidewave IDE. Generally speaking, you have two options to run Tidewave IDE with multiple subdomains:

  • Make the domains match, by accessing Tidewave IDE at the same domains as each application. This is the preferred option. In the example above, it means opening Tidewave IDE at localhost:9832 to access localhost:3000, and another Tidewave IDE at admin.localhost:9832 to access admin.localhost:3000. The downside of this approach, however, is that Tidewave IDE will store its settings and chats separately within each domain.

  • Run Tidewave IDE at localhost:9832 on both tabs to access localhost:9832 and admin.localhost:9832. In order for this to work, you will need to configure your framework to use cookies as SameSite=None; Secure, which we document below. Note that with this approach, your application storage (localStorage, etc) will be separate when accessed within Tidewave IDE and outside of it.

Configuring Cookies

To configure your cookies to use SameSite=None; Secure across different frameworks, follow the steps below. Note this requires you to run your application on a secure host, such as localhost and *.localhost, or use HTTPS.

Ruby on Rails

Add the following to config/initializers/development.rb:

config.session_store :cookie_store,
  key: "__your_app_session",
  same_site: :none,
  secure: true,
  assume_ssl: true

And make sure you are using rack-session version 2.1.0 or later.

Phoenix

Open up lib/your_app_web/endpoint.ex, find the code block that says if code_reloading? do, and then add the following line at the top:

if code_reloading? do
  @session_options Keyword.merge(@session_options, same_site: "None", secure: true)
  # here goes the remaining of the code reloading configuration
end

Vite

The session configuration depends on the library or framework you are using with Vite for session management. Please check their documentation accordingly.