Secrets store sensitive values like API keys, passwords, and tokens securely.
Secrets List - Manage API keys, passwords, and tokens
Secret Configuration - Encrypted storage with provider options
Store the value directly in the database (encrypted):
Code: api-key
Provider: inline
Value: sk_live_abc123...
Best for: Development, testing, values that rarely change.
Read the value from an environment variable:
Code: api-key
Provider: env
Value: SUPPLIER_API_KEY
The Value field contains the environment variable name, not the actual secret. The value is read at runtime.
Best for: Production, CI/CD pipelines, Docker deployments.
Reference secrets by code in step configurations.
Bearer token:
.extract('api-call', {
adapterCode: 'httpApi',
url: 'https://api.example.com/products',
bearerTokenSecretCode: 'api-key',
})
Basic auth:
.extract('api-call', {
adapterCode: 'httpApi',
url: 'https://api.example.com/products',
basicAuthSecretCode: 'api-credentials', // Format: username:password
})
API key header:
.extract('api-call', {
adapterCode: 'httpApi',
url: 'https://api.example.com/products',
apiKeySecretCode: 'api-key',
apiKeyHeader: 'X-API-Key',
})
// In connection configuration
{
code: 'erp-db',
type: 'postgres',
settings: {
host: 'db.example.com',
database: 'erp',
username: 'vendure',
passwordSecretCode: 'erp-db-password',
},
}
{
code: 'aws-storage',
type: 's3',
settings: {
region: 'us-east-1',
accessKeyIdSecretCode: 'aws-access-key',
secretAccessKeySecretCode: 'aws-secret-key',
},
}
{
code: 'supplier-ftp',
type: 'sftp',
settings: {
host: 'ftp.supplier.com',
username: 'vendure',
passwordSecretCode: 'sftp-password',
// Or for key-based auth:
privateKeySecretCode: 'sftp-private-key',
},
}
Note: You cannot view the existing value when editing.
Warning: Deleting a secret will break any pipelines or connections using it.
To rotate a secret:
Or, update the secret value directly:
All pipelines using that secret will use the new value immediately.
Define secrets in your Vendure config:
DataHubPlugin.init({
secrets: [
// From environment variable
{ code: 'api-key', provider: 'ENV', value: 'SUPPLIER_API_KEY' },
// Inline value (not recommended for production)
{ code: 'test-key', provider: 'INLINE', value: 'test-value' },
],
})
Code-first secrets:
{ code: 'api-key', provider: 'ENV', value: 'API_KEY' }
This keeps secrets out of your codebase and allows different values per environment.
ReadDataHubSecret permissionThe plugin is designed to never log secret values. If you’re extending the plugin, maintain this practice.