How can an extension add a custom attribute to the customers?

A similar code is used in my «Facebook Login» Magento 2 extension.

See also: