Actions4
Overview
This node allows sending Nostr protocol events to one or multiple relays. It supports different types of events, including basic notes, advanced custom events, raw JSON events, and encrypted direct messages (NIP-04). Users can create and send events with custom content, tags, and metadata, or provide fully formed raw JSON events.
Common scenarios include:
- Publishing simple text notes on the Nostr network.
- Sending encrypted direct messages between users.
- Broadcasting custom event types with specific tags and metadata.
- Forwarding pre-constructed raw JSON events directly to relays.
Practical example: A user wants to publish a note with some content and tags to several public relays simultaneously, ensuring wide distribution of their message.
Properties
| Name | Meaning |
|---|---|
| EventId | Hexadecimal event ID from a raw event or calculated manually. |
| Pubkey | Hexadecimal public key associated with the event. |
| Sig | Signature string verifying the event authenticity. |
| CreatedAt | Unix timestamp indicating when the event was created. |
| Json | Raw JSON string representing the entire event object. |
| Custom Relay | Comma-separated list of WebSocket relay URLs to which the event will be sent. |
Note: These properties are shown when "otherOption" is enabled for advanced event control.
Output
The node outputs an array of objects, each containing:
event: The event object that was sent, including all its fields such as content, kind, tags, id, pubkey, sig, and created_at.sendResults: An array of results corresponding to each relay the event was sent to, indicating success or failure per relay.
If binary data were involved, it would be summarized here, but this node only deals with JSON event data.
Dependencies
- Requires an API authentication token (secret key) to sign events.
- Uses the
nostr-toolslibrary for event encryption and finalization. - Uses WebSocket connections to communicate with Nostr relays.
- Requires configuration of relay URLs (default relays provided but customizable).
- No internal credential names are exposed; just ensure a valid secret key is configured.
Troubleshooting
- Invalid secret key error: If the secret key is missing or malformed, the node throws an error. Ensure a valid private key is provided.
- Invalid tags error: Tags must be a valid JSON array. Malformed or non-array tags cause an error.
- JSON parse failed: When using raw JSON events, invalid JSON strings will cause parsing errors.
- Relay connection issues: If relays are unreachable or reject the event, sending may fail silently or return error results in
sendResults. - Signature verification failures: If manually providing event ID, pubkey, or signature, ensure they match the event content and keys.