\documentclass{article}

\usepackage{glossaries-extra}

\glssetcategoryattribute{abbreviation}{insertdots}{true}

\newabbreviation{eg}{eg}{for example}

\begin{document}
\glsunsetall
\ttfamily

Test \gls{eg} mid-sentence.

Test e.g.\ mid-sentence.

\end{document}
