Dynamic inventory with authentication

I have a dynamic inventory which makes a call to a NMS API. It requires environment variables set for the username & password to use with the NMS and also with the NMS API URL. Is it possible to pass environment variables to the process that runs the dynamic inventory script on AWX? Is there a different/better way to pass these variables to the script?

Yes, inventory scripts using environments variables is standard.

You can make a source for an inventory that sources from a project, and give the relative location of the script. Things you put in the variables for the source will be injected as environment variables.

If you have secrets you will pass as environment variables, you should prefer to create a new custom credential type for this script, and supply a credential of that type to the inventory source.