This experiment was aimed to investigate the effects of dietary supplementation with porcine-derived bile acids (BAs) on production performance, immune function, serum metabolome, and liver transcriptome in heat-stressed laying hens. A total of 400 55-week-old Jingfen No.3 laying hens with similar body weight and laying rate were randomly allocated to 5 groups (8 replicates/group, 10 hens/replicate): normal temperature control group (CON, 26 ± 1°C, basal diet), high temperature control group (HS, 35 ± 1°C, basal diet), and three high-temperature BA-supplemented groups (HT, 35 ± 1°C, basal diet + 60, 120, or 240 mg/kg BAs). The CON group was maintained at normal temperature throughout the experiment, while the HS and HT groups were subjected to a cyclic temperature regime of 16 h high temperature/8 h normal temperature for 28 days. Compared with the CON group, the HS group showed significantly decreased laying rate, average egg weight, average daily feed intake, total egg mass, serum immunoglobulin A (IgA), immunoglobulin G (IgG), interleukin-10 (IL-10) levels and spleen index (P < 0.05), along with significantly increased serum corticosterone (CORT), heat shock protein 70 (HSP70), and interleukin-1β (IL-1β) contents (P < 0.05). Dietary supplementation with 120 mg/kg BAs significantly improved laying rate and total egg mass (P < 0.05), reduced serum CORT, HSP70, IL-1β and liver index levels (P < 0.05), and increased serum IgA, immunoglobulin M (IgM) levels and spleen index (P < 0.05) compared with the HS group. Serum metabolomics identified 129 differentially accumulated metabolites (DAMs), mainly including prostaglandin A₂ (PGA₂), 5,6-dihydroxyeicosatrienoic acid (5,6-DHET), 11,12,15-trihydroxyeicosatrienoic acid (11,12,15-THETA), and arachidonate. Liver transcriptomics revealed 347 differentially expressed genes (DEGs), primarily involving major histocompatibility complex class I (MHC I), interleukin-2 receptor (IL-2R), transforming growth factor-β receptor (TGF-βR), and multivesicular body protein 12A (MVB12A). Spearman correlation analysis indicated that IgA was significantly positively correlated with 11,12,15-THETA but significantly negatively correlated with arachidonate; IgM was significantly positively correlated with both 11,12,15-THETA and 5,6-DHET. Furthermore, 5,6-DHET was significantly positively correlated with MVB12A and IL-2R, and 11,12,15-THETA was also significantly positively correlated with MVB12A; arachidonate was significantly negatively correlated with MVB12A and TGF-βR. In conclusion, dietary supplementation with 120 mg/kg porcine-derived BAs can improve production performance by enhancing immune function in heat-stressed laying hens.