The role of XBP1 expression in maintaining glucose homeostasis, glycaemic control, and response to diabetes therapeutics across human populations has not been previously studied. Here, XBP1 is linked to diabetes mellitus.