This plugin adds support for a masked password-style field to CMB2.
See the CMB2 Wiki for information on how to use CMB2.
This field behaves just like CMB2's text field type.
$metabox->add_field(
[
'name' => 'My API Key',
'desc' => 'API key for some service',
'default' => '',
'id' => 'my-api-key',
'type' => 'password',
]
);