Set a static front-page as a landing page programmatically

You can do it by targeting get_option('show_on_front');

some code which could help would be:

function themename_after_setup_theme() {
 $site_type = get_option('show_on_front');
 if($site_type == 'posts') {
  update_option( 'show_on_front', 'page' );
  update_option( 'page_for_posts', 'page-name' );
 }
}
add_action( 'after_setup_theme', 'themename_after_setup_theme' );

This will run on theme activation only, remember to change the page-name to the page you want to be set as the homepage.

This isn’t tested but have used this on a similar project before