@deploybaseline/sendgrid
v0.14.0
Published
SendGrid email API emulator for local development and tests: Mail Send v3 with SendGrid's validation, scheduling, dynamic and legacy templates with Handlebars rendering, API keys with scopes, Marketing contacts and lists, the Event Webhook with ECDSA sign
Readme
@deploybaseline/sendgrid
SendGrid email API emulator for local development and tests: Mail Send v3 with SendGrid's validation, scheduling, dynamic and legacy templates with Handlebars rendering, API keys with scopes, Marketing contacts and lists, the Event Webhook with ECDSA signatures, suppressions, simulated engagement events, and an inbox.
Part of Baseline: local drop-in replacement services for CI and no-network sandboxes.
Usage
npx @deploybaseline/cli start --service sendgridSendGrid starts only when named in config or with --service. In tests, start it from code:
import { createEmulator } from "@deploybaseline/cli";
import { Client } from "@sendgrid/client";
const sendgrid = await createEmulator({ service: "sendgrid" });
const client = new Client();
client.setApiKey("SG.baseline_local.local_secret_for_development_only");
client.setDefaultRequest("baseUrl", `${sendgrid.url}/`); // after setApiKey, which resets it
await sendgrid.close();Documentation
- SendGrid docs: auth, Mail Send, Handlebars, scheduling, templates, Marketing, the Event Webhook, simulate routes, suppressions, and seed config
- API reference:
http://localhost:3999/docs/sendgridwhile the CLI runs (how it works)
License
Apache-2.0
