A 16-year-old boy has been arrested as police investigate a social media threat against a newly opened mosque in western Sydney.

A 16-year-old boy has been detained as authorities look into a social media threat targeting a newly established mosque in western Sydney.