It is possible to use your own version of ArcGIS API for JavaScript by setting the variable apiUrl in env.js
However make sure this API will be available from within your apps. E.g. if you deploy them onto another domain.
Hi Mathieu,
Yes and I think the link below is a good resource to better assist you, works same as WAB:
How To: Install the JavaScript API for use with ArcGIS for Server
Baba