In the various subfields of physics, there exist two common usages of the term flux, both with rigorous mathematical frameworks.
Generally, in particular in the field of electromagnetism and mathematics, flux is usually the integral of a vector quantity, flux density, over a finite surface. It is an integral operator that acts on a vector field similarly to the gradient, divergence and curl operators found in vector analysis. The result of this integration is a scalar quantity called flux. The magnetic flux is thus the integral of the magnetic vector field B over a surface, and the electric flux is defined similarly. Using this definition, the flux of the Poynting vector over a specified surface is the rate at which electromagnetic energy flows through that surface. Confusingly, the Poynting vector is sometimes called the power flux, which is an example of the second usage of flux, below. It has units of watts per square metre (W/m2)
In this context, flux has a primary mathematical definition in terms of a surface integral which uses the vectors that represent the force which is causing the flux being studied.
In the study of transport phenomena (heat transfer, mass transfer and fluid dynamics), flux is defined as the amount that flows through a unit area per unit time. Generally that definition is the definition for flux density. Flux in this definition is a vector.
One could argue, based on the work of James Clerk Maxwell, that the transport definition precedes the more recent way the term is used in electromagnetism. The specific quote from Maxwell is "In the case of fluxes, we have to take the integral, over a surface, of the flux through every element of the surface. The result of this operation is called the surface integral of the flux. It represents the quantity which passes through the surface". [wikipedia.com]
Fluxoid or Fluxon
Quantized unit of flux.
(Such a superconducting current is quantized in integral multiples of a certain unit of flux, called a fluxoid or fluxon, and so the current consists of a certain number of such fluxoids in circulation).
James Clerk Maxwell
"9 coefficients determine the relationship between flux and intensity
6 of these coefficients form 3 pairs of equal quantities
3 pairs of equal coefficients will self-conjugate." [James Clerk Maxwell]
The original quote from "https://svpwiki.com/pdffiles/A_Treatise_on_Electricity_and_Magnetism.pdf - vol. I".
"The case in which the components of the flux are linear functions of those of the force is discussed in the chapter on the Equations of Conduction, Art. 296. There are in general nine coefficients which determine the relation between the force and the flux. In certain cases we have reason to believe that six of these coefficients form three pairs of equal quantities. In such cases the relation between the line of direction of the force and the normal plane of the flux is of the same kind as that between a diameter of an ellipsoid and its conjugate diametral plane. In Quaternion language, the one vector is said to be a linear and vector function of the other, and when there are three pairs of equal coefficients the function is said to be self-conjugate." [James Maxwell, A Treatise on Electricity and Magnetism - vol. I]