Using embedded app for shopify. The methods in the js API reference don't seem to match or all be available

I am using the app embed feature in shopify. The provided code for in the UI for manual injection seems to be different than the code that is running from the app embed. Does the js api reference not apply to this method of code injection? Is there another object to reference, other than Tawk_API? onPrechatSubmit does not exist apparently, as I am getting an error that it is undefined, although the Tawk_API is loaded. Am I missing something? Recommendations?