Unable to get runtime Constants.nativeBuildVersion in EAS Build

I’m trying to get an auto-incrementing build number for my iOS builds on EAS. According to the docs I can get this from Constants.nativeBuildVersion, but the Constants module can’t be imported in app.config.js. I get this error if I try to import Constants in app.config.js: Cannot use import statement outside a module

Is there another way to get the build number at runtime?