Providers

Local

Print emails to the console instead of sending them.

The local provider doesn't send anything. It prints every email to the console and keeps a list of the sent messages, which makes it useful for development and tests.

import { createClient } from '@nicogenz/emails-sdk';
import { local } from '@nicogenz/emails-sdk/local';

const email = createClient({ provider: local() });

Options

OptionTypeDefaultDescription
logbooleantruePrint each email to the console.

Testing

Turn off the console output and check provider.sent in your assertions.

const provider = local({ log: false });
const email = createClient({ provider });

await email.send({
  from: 'hello@acme.com',
  to: 'jane@example.com',
  subject: 'Welcome',
  text: 'Hi Jane',
});

expect(provider.sent).toHaveLength(1);
expect(provider.sent[0]).toMatchObject({ subject: 'Welcome' });
Copyright © 2026