<script>YOUR CUSTOM JS CODE</script>
inline does the same exact thing as YOUR CUSTOM JS CODE
placed in a js file.
I see no problem with the use of your app key in a js file. There is a few points to consider here though
-
If your script is dependent on the main jquery library, just remember to set the
$deps
when you enqueue your script, otherwise it will not work if it loads to early -
Make use of conditional tags to load your script only on selected pages
This way I cannot see that your script should fail