Digital pot could have more noise compared to a discrete resistor.
The amplifier can be split into two (2) stages.
1st stage is a fixed gain transimpedance amplifier. (One could call it a pre-amp.)
2nd stage is a variable gain amplifier with a digital pot. The 2nd stage shall have a strong input signal from the 1st stage, so the noise from the digital pot would have only a small impact.
There is also a concern that a digital communication signals from which the digital pot receives its setting (e.g. I2C, SPI, etc) can crosstalk into the analog path of the pot. I've seen that happen with D/A converters. Check this with an oscilloscope: trigger the scope from the digital lines, observe the analog signal. If you see this problem, it can be addressed by creating a quiet period without digital communication, during which the measurement would be made.