I have a custom module. It's FormBase to create a form. And on submit, I post values to an API. All this works. But I want to change the base URL variable (which is used in multiple methods) so that when you on any environment besides live you get a different URL.

I want to figure out the Drupal 8 way of doing this.

class EventSuggestionForm extends FormBase {
  private $baseUrl = 'https://www.example.com'; // Needs to be different if not the live site.
  private $apiUrl = '/api/v1/';

Can I get some advice?