  We analyze a general theory for coexistence and extinction of ecological
communities that are influenced by stochastic temporal environmental
fluctuations. The results apply to discrete time (stochastic difference
equations), continuous time (stochastic differential equations), compact and
non-compact state spaces and degenerate or non-degenerate noise. In addition,
we can also include in the dynamics auxiliary variables that model
environmental fluctuations, population structure, eco-environmental feedbacks
or other internal or external factors.
  We are able to significantly generalize the recent discrete time results by
Benaim and Schreiber (Journal of Mathematical Biology '19) to non-compact state
spaces, and we provide stronger persistence and extinction results. The
continuous time results by Hening and Nguyen (Annals of Applied Probability
'18) are strengthened to include degenerate noise and auxiliary variables.
  Using the general theory, we work out several examples. In discrete time, we
classify the dynamics when there are one or two species, and look at the Ricker
model, Log-normally distributed offspring models, lottery models, discrete
Lotka-Volterra models as well as models of perennial and annual organisms. For
the continuous time setting we explore models with a resource variable,
stochastic replicator models, and three dimensional Lotka-Volterra models.
