Skip to content
emailkit
Esc
navigateopen⌘Jpreview
On this page

mailbox.onAuthUpdated

emailkit refreshed a mailbox's tokens — overwrite what you stored.

Fires when emailkit refreshes a connected mailbox’s tokens. Overwrite the stored auth — the old one is dead, and the next operation on this mailbox needs the new one.

hooks: {
  mailbox: {
    onAuthUpdated: async ({ mailbox, auth }) => {
      if (!mailbox?.email) return;
      await prisma.connectedMailbox.updateMany({
        where: { email: mailbox.email },
        data: { auth: encrypt(auth) },
      });
    },
  },
},

Payload

PropType
emailDriverstring
Typestring
mailboxMailboxIdentity
TypeMailboxIdentity
authunknown
Typeunknown
context?unknown
Typeunknown
raw?unknown
Typeunknown

Last updated on July 24, 2026

Was this page helpful?