@sendlyapp/sdk
v0.1.1
Published
Node.js SDK for the Sendly API
Readme
Sendly SDK for JavaScript
A simple JavaScript SDK for Sendly API access from Node.js or Bun.
For questions, visit: https://docs.usesendly.app
Installation
npm install @sendlyapp/sdkOr with Bun:
bun add @sendlyapp/sdkQuick Start
1. Get your API key
Create your account and generate your API key at usesendly.app.
2. Set your API key
You can pass the key directly or use the SENDLY_API_KEY environment variable.
import { Sendly } from '@sendlyapp/sdk'
const client = new Sendly(process.env.SENDLY_API_KEY)If no key is passed, the SDK uses process.env.SENDLY_API_KEY.
3. Send a simple email
const response = await client.emails.send({
from: '[email protected]',
to: '[email protected]',
subject: 'Hello from Sendly',
reply_to: '[email protected]',
text: 'Hello world',
html: '<h1>Hello world</h1><p>This is a test email.</p>'
})
console.log(response)Main Resources
Emails
client.emails.send(payload)client.emails.list(query)client.emails.get(id)
Inbound
client.emails.inbound.list(query)client.emails.inbound.get(id)
Envelope
client.emails.envelope.list(query)
Domains
client.domains.create(payload)client.domains.list(query)client.domains.get(identifier)client.domains.update(identifier, payload)client.domains.delete(identifier)client.domains.verify(identifier)
Webhooks
client.webhooks.create(payload)client.webhooks.list(query)client.webhooks.get(id)client.webhooks.update(id, payload)client.webhooks.delete(id)
Logs
client.logs.list(query)
Docs
For full documentation, see:
- https://docs.usesendly.app
