Docs
Using eConnect
eConnect has two identities in every call: you, the developer, authenticated by your Empire ID key — and your end-user, identified by whatever user_id string you use internally. Your key never touches your users' personal tokens; those stay in eConnect's vault.
1. Install the SDK
npm install econnect-sdk2. Initialize
const EConnect = require('econnect-sdk');
const eConnect = new EConnect(
'https://api.empireunion.xyz', // your eConnect base URL
process.env.ECONNECT_API_KEY // your Empire ID key, from the dashboard
);3. Send something
// Messaging
await eConnect.messaging.sendText('telegram', chatId, 'Hello!');
await eConnect.messaging.sendEmail(userId, 'gmail', to, subject, text, html);
// Music
await eConnect.music.play(userId, 'spotify:track:...', 'spotify');
await eConnect.music.getDevices(userId, 'spotify');4. Connect a user's account
Before you can act on behalf of a user (send their Gmail, control their Spotify), they need to connect that account once:
https://api.empireunion.xyz/auth/spotify/connect
?user_id=YOUR_INTERNAL_USER_ID
&callback_url=https://yourapp.com/connectedAction reference
Messaging
telegram
send_text, send_media, send_document, edit_message, get_history, delete_message
discord
send_text, send_embed, add_reaction, get_history
slack
send_text, update_message, send_blocks, get_history
gmail
send_email (supports optional html)
sendgrid
send_email (supports optional html)
resend
send_email (supports optional html)
github
create_issue, add_comment, star_repo, custom
twilio
send_sms, send_whatsapp, make_call, get_message_status, custom
Music
spotify
search, play, pause, skip, get_current, get_devices, add_to_queue
youtube
search, get_details
deezer
search, get_details
Rate limits & quotas
Every plan has a monthly request allowance and a per-minute rate limit. Both reset at the start of each billing cycle. Check your current usage anytime on your dashboard.