helios-send-browser
v0.2.0
Published
Browser-safe SDK for HeliosSend email delivery service
Downloads
186
Maintainers
Readme
helios-send-browser
Browser-safe SDK for HeliosSend email delivery service, built by Revinity.
⚠️ Security Warning
Never embed master API keys in frontend code!
This package is designed for browser use with short-lived tokens only. For production apps, prefer:
- Using
helios-send-reactwith a backend relay endpoint - Using
helios-send-nextto create secure API handlers - Generating short-lived tokens on your backend
Installation
npm install helios-send-browser
# or
pnpm add helios-send-browser
# or
yarn add helios-send-browserUsage
Only use this if you have a secure token generation system:
import { HeliosBrowserClient } from 'helios-send-browser';
// Token should be generated on your backend with limited scope
const client = new HeliosBrowserClient({
token: shortLivedToken, // from your backend
baseUrl: 'https://api.helios-send.com',
});
await client.send({
from: { email: '[email protected]' },
to: [{ email: '[email protected]' }],
subject: 'Hello',
html: '<p>Hello from HeliosSend!</p>',
});Recommended Approach
Instead of using this package directly, use:
- React:
helios-send-reactwith a backend endpoint - Next.js:
helios-send-nextto create secure handlers - Other frameworks: Create a backend relay endpoint
See the main documentation for more details.
