In-situ Synchrotron XRD for hydrogen absorption of Mg–Ni alloys is demonstrated. A N2 content as low as 0.5 mol% can completely inhibit the hydriding of pure Mg2Ni. Na-doped Mg2Ni remains relatively unaffected even at up to 5 mol% of N2. The activated Mg–Ni alloy shows excellent hydriding kinetics under 1 mol% of N2. The effect of Na is assessed based on microstructural effect and chemical analysis.