A nanosensor-containing polymer composition for the monitoring of physiological parameters and a method for making the composition are disclosed. The composition includes a fluid nanosensor-containing polymer that becomes rigid in the presence of physiological conditions. In the fluid form, the composition can be suitable for injection on to or into the skin. In the rigid form, the nanosensor is substantially immobilized in the polymer. The method includes forming a mixture comprising a nanosensor and polymer precursor(s), subjecting the mixture to conditions suitable for forming the fluid form of the composition; and subjecting the fluid form to physiological conditions to provide a rigid nanosensor-containing composition.