Which handle should I use when calling wp_localize_script()?

I’m trying to use Ajax with Sage. The JS script in which I make the Ajax call (using $.post()) is located in scripts.js at the root of my Sage theme. Then in my functions.php (or more precisely in lib/extras.php) I do:

wp_enqueue_script( 'js_scripts', get_stylesheet_directory_uri() . '/scripts.js', array('jquery'), true ); 
wp_localize_script( 'js_scripts', 'WPaAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );

But this requires me to keep my JS Ajax call in its own separate JS file, whereas I’d prefer to put it with the rest of my custom JS code in main.js. However if I do so then which handle should I use when running wp_localize_script()? I tried wp_localize_script( 'sage/js', 'WPaAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); but it doesn’t work.

Have you looked at the other threads about this?


The only thread that would be close to my issue is Wp_localize_script best practices? but it deals with localizing a separate JS file, whereas I want to localize the main JS file of SAGE and put my Ajax-related JS in there.