Module to create a custom field in all the content types
Instead of installing the field in your install hook (which will be triggered when installing the module only), you should implement hook_entity_base_field_info() to add the field to all nodes and all bundles.

An example below:

use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;

/**
 * Implements hook_entity_base_field_info().
 *
 * Attaches a custom field 'field_custom_tocken' to all nodes.
 */
function mymodule_entity_base_field_info(EntityTypeInterface $entity_type) {
  // Whether the entity type is 'node'.
  if ($entity_type-&gt;id() == 'node') {
    return [
      'field_custom_tocken' =&gt; BaseFieldDefinition::create('string')
        -&gt;setName('field_custom_tocken')
        -&gt;setLabel(t('Tocken'))
        -&gt;setDescription(t('My tocken, which might be named token instead.'))
        -&gt;setSettings([
          'max_length' =&gt; 150,
          'text_processing' =&gt; 0,
        ])
        -&gt;setDefaultValue('')
        -&gt;setDisplayOptions('view', [
          'label' =&gt; 'above',
          'type' =&gt; 'string',
          'settings' =&gt; [
            'link_to_entity' =&gt; FALSE,
          ],
          'weight' =&gt; 0,
        ])
        -&gt;setDisplayOptions('form', [
          'type' =&gt; 'string_textfield',
          'weight' =&gt; 0,
        ])
        -&gt;setDisplayConfigurable('form', TRUE)
        -&gt;setDisplayConfigurable('view', TRUE),
    ];
  }
}