Functions as a transcription factor during endoplasmic reticulum (ER) stress by regulating the unfolded protein response (UPR). Required for cardiac myogenesis and hepatogenesis during embryonic development, and the development of secretory tissues such as exocrine pancreas and salivary gland. Involved in terminal differentiation of B lymphocytes to plasma cells and production of immunoglobulins. Modulates the cellular response to ER stress in a PIK3R-dependent manner. Binds to the cis-acting X box present in the promoter regions of major histocompatibility complex class II genes. Involved in VEGF-induced endothelial cell (EC) proliferation and retinal blood vessel formation during embryonic development but also for angiogenesis in adult tissues under ischemic conditions. Functions also as a major regulator of the UPR in obesity-induced insulin resistance and type 2 diabetes for the management of obesity and diabetes prevention.