Railway
Deploy an app to Railway that sends your first email using the sendping SDK.
Railway lets you focus on building your product instead of managing infrastructure, scaling automatically as you grow. Use the sendping Node SDK — it works the same on Railway as in any Node.js host. Install it with npm install sendping.
Prerequisites
Before you start, you will need:
- A SendPing API key.
- A verified domain to send from.
- A Railway account.
1. Install the SDK
npm install sendping2. Create a Railway project
Create a new project on Railway and deploy a Node.js service (for example, from a GitHub repo or with railway init from the Railway CLI).
3. Add your API key
In your service's Variables tab, add SENDPING_API_KEY with your key. Railway injects it into the runtime environment so you never commit the secret.
SENDPING_API_KEY=mb_xxxxxxxxx4. Send your first email
In a request handler (here, a minimal Node.js HTTP server), instantiate the SDK client and call mb.emails.send().
import { createServer } from 'node:http';
import { SendPing } from 'sendping';
const mb = new SendPing(process.env.SENDPING_API_KEY);
createServer(async (_req, res) => {
const { data, error } = await mb.emails.send({
from: 'Acme <onboarding@yourdomain.com>',
to: ['delivered@test.sendping.co'],
subject: 'hello world',
html: '<strong>it works!</strong>',
});
res.writeHead(error ? 500 : 200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify(error ? { error } : { data }));
}).listen(process.env.PORT || 3000);5. Deploy and verify
Once your deployment finishes, open the deploy URL to send your first email.