()
| 95 | let defaultClient: TestmailClient | null = null |
| 96 | |
| 97 | export function getTestmailClient(): TestmailClient { |
| 98 | if (!defaultClient) { |
| 99 | const apiKey = process.env.TESTMAIL_API_KEY |
| 100 | const namespace = process.env.TESTMAIL_NAMESPACE |
| 101 | |
| 102 | if (!apiKey || !namespace) { |
| 103 | throw new Error( |
| 104 | "TESTMAIL_API_KEY and TESTMAIL_NAMESPACE environment variables are required", |
| 105 | ) |
| 106 | } |
| 107 | |
| 108 | defaultClient = new TestmailClient({apiKey, namespace}) |
| 109 | } |
| 110 | return defaultClient |
| 111 | } |
| 112 | |
| 113 | export type {Testmail} |
no outgoing calls
no test coverage detected