diff --git a/src/composables/useNostrChat.ts b/src/composables/useNostrChat.ts index d84856d..22d221e 100644 --- a/src/composables/useNostrChat.ts +++ b/src/composables/useNostrChat.ts @@ -20,18 +20,14 @@ export interface NostrRelayConfig { write?: boolean } -// Get relays from config or use defaults +// Get relays from config - requires VITE_NOSTR_RELAYS to be set const getRelays = (): NostrRelayConfig[] => { const configuredRelays = config.nostr.relays - if (configuredRelays && configuredRelays.length > 0) { - return configuredRelays.map((url: string) => ({ url, read: true, write: true })) + if (!configuredRelays || configuredRelays.length === 0) { + throw new Error('VITE_NOSTR_RELAYS environment variable must be configured for chat functionality') } - // Fallback relays if none configured - return [ - { url: 'wss://relay.damus.io', read: true, write: true }, - { url: 'wss://nos.lol', read: true, write: true } - ] + return configuredRelays.map((url: string) => ({ url, read: true, write: true })) } export function useNostrChat() {