Quickstart Guide
Send your first email with Samva in 5 minutes
Get up and running with Samva's messaging platform in just a few minutes.
Prerequisites
Before you begin, make sure you have:
- A Samva account (sign up at samva.app/signup)
- Node.js 18+ installed (for TypeScript SDK)
Step 1: Get Your API Key
- Log in to your Samva Dashboard
- Navigate to Developers → API Keys
- Click Create API Key
- Copy your API key and keep it secure
Security Tip: Never commit API keys to version control. Use environment variables instead.
Step 2: Install the SDK
Choose your preferred method:
npm install samvaStep 3: Initialize the Client
import { createSamvaClient } from 'samva';
const samva = createSamvaClient({
apiKey: process.env.SAMVA_API_KEY!
});Step 4: Send Your First Email
// Send transactional email
const response = await samva.email.send({
body: {
to: 'user@example.com',
subject: 'Welcome to Samva',
htmlContent: '<h1>Welcome!</h1><p>Thanks for joining Samva.</p>',
textContent: 'Welcome! Thanks for joining Samva.'
}
});
console.log('Email sent:', response.data?.messageId);Step 5: Check Message Status
// Get message status
const message = await samva.messages.get({
path: { id: response.data?.messageId! }
});
console.log('Delivery status:', message.data?.status);
// Possible values: pending, processing, sent, delivered, failedUsing REST API
If you prefer using the REST API directly:
# Send email via REST API
curl -X POST https://samva.app/api/v1/email/send \
-H "X-API-Key: sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"to": "user@example.com",
"subject": "Welcome to Samva",
"htmlContent": "<h1>Welcome!</h1><p>Thanks for joining Samva.</p>",
"textContent": "Welcome! Thanks for joining Samva."
}'Next Steps
API Reference
Explore all available endpoints
Authentication
Learn about API keys and security
Email Management
Manage email domains, senders, and templates
Webhooks
Set up real-time event notifications
Common Issues
Invalid Email Address
Error: Invalid email address formatSolution: Ensure the email address is properly formatted (e.g., user@example.com).
Domain Not Verified
Error: Sender domain not verifiedSolution: Verify your sending domain in the dashboard under Email → Domains.
Insufficient Credits
Error: Insufficient credits in walletSolution: Top up your credits in the Billing Dashboard.
Support
Need help? We're here for you:
- 📧 Email: support@samva.app
- 📚 Full Documentation: samva.app/docs
- 🐛 Report Issues: github.com/samva