How do I send email from Cloud Functions for Firebase?
Install notix-js in your functions directory, store the API key with firebase functions:secrets:set, declare it with defineSecret and list it in the trigger's secrets option. Inside the handler, construct the client with the secret's value and call emails.send with from, to, subject and html or react. The from address must be on a domain you verified in Notix. An onCall function is the usual entry point from a web or mobile app; a Firestore trigger is the usual way to send a receipt when an order document is written.
Can Firebase Auth send its verification and password reset emails through Notix?
Yes. The Firebase console's Authentication section has a Templates tab with SMTP settings, where you can point Firebase's own emails at a custom SMTP server instead of the default sender. Enter the relay host, port 465 or 587, the username notix and an API key as the password, and a sender address on a domain you verified in Notix. From then on every verification, reset and address-change email Firebase sends is a Notix send: tracked in the dashboard, subject to the suppression list, and reported to your webhooks.
Where do I keep the API key?
In Cloud Secret Manager, via firebase functions:secrets:set NOTIX_API_KEY. Declare it in code with defineSecret and bind it with the secrets option on each function that sends; the value is only readable inside the handler with .value(). Do not put it in firebase functions:config, in a committed .env file, or in any client-side Firebase config. For the emulator, use a separate key in functions/.env.local and revoke it afterwards.
Why did my Firestore trigger send the same email twice?
Cloud Functions delivers events at least once, and a function with retry enabled runs again after any failure, including a timeout that happened after your send had already gone out. Pass an idempotency key derived from the document id on every send. Notix keeps the key for 24 hours and answers a repeat with the original email rather than sending a second one, so the retry is harmless.
Is there a Notix Firebase Extension?
No. Notix does not publish a Firebase Extension, and this page does not need one: the SDK call is a few lines inside a function you already control, and the Auth emails go through SMTP settings Firebase provides. If you currently use the Trigger Email extension, its SMTP connection string can point at the relay with the same host, port and credentials, and your mail collection keeps working.
Does the relay work from the Firebase Hosting rewrite to a function?
Yes, because the relay and the API are reached from the function, not from the browser. A Hosting rewrite only changes the URL your client calls; the function still runs on Cloud Run with the secret bound to it. What you must not do is call the Notix API from client code with the key in a Firebase web config, where anyone can read it.