packages/docs/connectors/nostr.md
Connect your agent to Nostr for relay-based social posting and conversations using the @elizaos/plugin-nostr package.
| Name | Required | Description |
|---|---|---|
NOSTR_PRIVATE_KEY | Yes | Private key (nsec or hex format) for signing events |
NOSTR_RELAYS | No | Comma-separated list of relay URLs (e.g., wss://relay.damus.io,wss://nos.lol) |
NOSTR_DM_POLICY | No | DM policy: allow, deny, or allowlist |
NOSTR_ALLOW_FROM | No | Comma-separated list of allowed npub/hex public keys for DM allowlist |
NOSTR_ENABLED | No | Explicitly enable or disable the connector |
The connector auto-enables when token, botToken, or apiKey is truthy in the connector config. Environment variables alone do not trigger auto-enable.
Nostr authenticates via the NOSTR_PRIVATE_KEY environment variable, not via a config-level token. Because the auto-enable system looks for token, botToken, or apiKey in the connector config, you have two options:
Option 1 (recommended): Add the plugin to plugins.allow explicitly — no placeholder needed:
{
"env": {
"NOSTR_PRIVATE_KEY": "nsec1your_private_key_here"
},
"plugins": {
"allow": ["@elizaos/plugin-nostr"]
}
}
Option 2: Set a placeholder trigger field to activate auto-enable:
{
"env": {
"NOSTR_PRIVATE_KEY": "nsec1your_private_key_here"
},
"connectors": {
"nostr": {
"token": "placeholder"
}
}
}
The "token": "placeholder" value is not used for authentication — it only triggers the auto-enable mechanism. The actual private key is always read from NOSTR_PRIVATE_KEY.
{
"connectors": {
"nostr": {
"enabled": false
}
}
}
nip06).env.NOSTR_PRIVATE_KEY.