Among all the accounts, direct witness and heavenly revelations that provide us with details about the Virgin Mary and the Holy Family but are not mentioned in the four Gospels, the New Testament apocrypha certainly rank high.
Let's first address a misconception: although they are not part of the canonical Bible, these writings should not be dismissed as fanciful and imaginative legends intended to add color to the more dry Gospel texts.
On the contrary, they have been regarded with the utmost seriousness since the earliest days of the Church. Certainly, some were rejected and/or invalidated. But others have inspired the writings of great Christian minds. This is particularly true of the Proto-gospel of James, which is believed to have been written in the 2nd century, and is likely the source of the Gospel of Pseudo-Matthew.
These texts contain a wealth of information about Mary. In the Carolingian era, Pseudo-Matthew was known as The Book About the Origin of the Blessed Mary and the Childhood of the Savior.
It is through this book that we know the identity of the Virgin's parents, Anne (who was sterile) and Joachim; that Mary was consecrated to God from childhood; and that Christ was born in a cave, not just the manger (i.e. feeding trough) that St. Luke mentions.
A sign that the Church considered these texts reliable is that She used them to establish the Feast of the Presentation of Mary in the Temple (November 21). Its spiritual message is crucial because it is about the complete gift of Mary's heart to God.
The Church also used these texts to define the dogma of Mary's perpetual virginity, since the Gospel of James insists on the preservation of her virginity after the birth of Christ.