To use Bitwarden custom fields, open any vault item, scroll to the “Custom Fields” section, and click “Add Item” to create Text (visible metadata), Hidden (masked values like API keys), or Protected (extra-secure, non-searchable) fields. Custom fields let you store API keys, database connection strings, SSH configurations, and environment tags alongside your login credentials, and you can retrieve them programmatically via the Bitwarden CLI with bw get item "name" | jq '.fields[]'.

What Are Custom Fields?

Custom fields are additional data points you can attach to any vault item in Bitwarden. Each field consists of a name and value, with optional attributes for masking (hiding the value) or marking the field as a protected note. This flexibility makes custom fields ideal for storing API keys, database credentials, server addresses, and other developer-specific information.

To access custom fields, open any vault item in the Bitwarden web vault, desktop app, or browser extension. Scroll past the standard login fields to find the “Custom Fields” section. Click “Add Item” to create your first custom field.

Field Types and Their Applications

Bitwarden supports three distinct field types, each serving different use cases:

Text Fields store plain text values. Use these for URLs, server hostnames, or any non-sensitive metadata you want to associate with an entry. Text fields appear as readable text in the vault.

Hidden Fields mask their values similar to password fields. These are appropriate for API keys, tokens, or any sensitive string you don’t want visible on screen. Hidden fields still copy to clipboard normally when you click them.

Protected Fields provide an additional security layer. The value remains hidden and requires explicit action to reveal. Protected fields cannot be searched or exported in plaintext, making them suitable for particularly sensitive data like recovery codes or encryption keys.

Practical Examples for Developers

Storing API Credentials

For services requiring API keys, create a dedicated login item with custom fields:

Service: GitHub
Username: dev@example.com
Password: [master password]

Custom Fields:
- API Key (Hidden): ghp_xxxxxxxxxxxxxxxxxxxx
- Organization (Text): my-company
- OAuth Secret (Protected): [sensitive value]

This organization keeps all authentication-related data in one place while clearly separating human credentials from machine credentials.

Database Connection Strings

Database credentials often require multiple pieces of information. Custom fields handle this elegantly:

Item: Production Database
Password: [database password]

Custom Fields:
- Host (Text): db.prod.example.com
- Port (Text): 5432
- Database (Text): main_app_production
- SSL Mode (Text): require
- Connection String (Text): postgresql://user@db.prod.example.com:5432/main_app_production

The connection string field aggregates the individual values into a format ready for direct use in configuration files or environment variables.

SSH Key Management

Managing SSH keys becomes simpler with custom fields:

Item: Production Server SSH
Password: [SSH key passphrase]

Custom Fields:
- Host (Text): production.example.com
- Port (Text): 22
- Private Key (Protected): [paste private key content]
- Public Key (Text): ssh-rsa AAAAB3NzaC1...
- Jump Host (Text): bastion.example.com

This approach keeps all SSH configuration details accessible alongside your credentials, eliminating the need to search through documentation or configuration files.

Automating with the Bitwarden CLI

The Bitwarden command-line interface (CLI) provides programmatic access to custom fields, enabling automation scripts and integration with development workflows.

Install the CLI using npm:

npm install -g @bitwarden/cli

Authenticate with your vault:

bw login your@email.com

Retrieve an item and extract custom field values using JSON parsing:

# Get item with custom fields
bw get item "GitHub API" | jq '.fields[] | select(.name == "API Key") | .value'

This command returns the API key value directly, making it useful for shell scripts:

#!/bin/bash
API_KEY=$(bw get item "GitHub API" | jq -r '.fields[] | select(.name == "API Key") | .value')
curl -H "Authorization: token $API_KEY" https://api.github.com/user

The CLI also supports creating items with custom fields programmatically:

bw create item login '{
  "name": "New API Service",
  "login": {
    "username": "service-account",
    "password": "generated-password"
  },
  "fields": [
    {"name": "API Key", "value": "key-value", "type": 1},
    {"name": "Environment", "value": "production", "type": 0}
  ]
}'

Field type 0 represents text, while 1 represents hidden fields.

Organizing Large Vaults

Custom fields shine when organizing vault entries for large projects or multiple environments. Create consistent field naming conventions across items:

Use a text field named “Environment” with values like “production”, “staging”, or “development” on every credential item as an environment tag. Add a “Project” text field to group related credentials across different services.

For expiration tracking, store expiration dates in an “Expires” text field. Write a script using the CLI to check for upcoming expirations:

bw list items | jq -r '.[] | select(.fields != null) | select(.fields[] | .name == "Expires") | "\(.name): \((.fields[] | select(.name == "Expires") | .value))"'

Security Considerations

While custom fields enhance organization, follow security best practices:

Never store plaintext passwords in text fields—use hidden or protected fields instead. Be cautious with clipboard operations; clear clipboard data after copying sensitive values. The Bitwarden CLI supports automatic clipboard clearing with the --clipboard flag and --timeout parameter.

When sharing items through Bitwarden Send or organizational sharing, custom field visibility depends on the item’s sharing settings. Review shared items carefully to ensure sensitive fields aren’t exposed unintentionally.

Conclusion

Custom fields transform Bitwarden from a simple password manager into a structured credential management system. By attaching structured metadata to vault entries, developers can maintain organized credential libraries, automate authentication workflows, and ensure consistent security practices across projects.

The combination of different field types, CLI automation, and organized naming conventions creates a powerful system suitable for managing complex development environments, multiple service accounts, and sensitive infrastructure credentials.

Built by theluckystrike — More at zovo.one