Last updated September 20, 2015. Created on July 2, 2012.
Edited by HongPong, sidharrell, mtift, nedjo. Log in to edit this page.

The configuration API provides a central place for modules to store configuration data. This data can be simple configuration like your site name, or more complex information managed with configuration entities, such as views and content types.

Configuration is a place to store information that you would want to synchronize from development to production. This information is often created during site building and is not typically generated by regular users during normal site operation. D8 Configuration helps replace variable_get and variable_set.

You should use the State API, not configuration, for storing local variables that shouldn't travel between instances. Use state for hidden system values, and if you never want to deploy it between environments. You can reset a system, losing all state. Its configuration remains.

The configuration API comes in two flavours - the (simple) Config API and the Configuration Entity API. The key difference is that the Config API is the singleton usecase. A singleton is where there can be only a single instance of this configuration. A good example would be the site's name.

The Configuration Entity API should be used to store multiple sets of configuration - for example node types, views, vocabularies, and fields.

Updating the configuration API is vital to avoiding fatal errors when updating themes and modules to work in Drupal 8. See Updating themes and updating modules info.

More information

Managing configuration in Drupal 8

Looking for support? Visit the forums, or join #drupal-support in IRC.