Skip to content

Missing exports:InboundWebhookPayload, verifyWebhookFromHeaders #28

Closed

Description

@nbbaier

The docs say that inboundemail exports the type InboundWebhookPayload and the function verifyWebhookFromHeaders. But those two exports don't actually exist:

Image

Activity

  1. R44VC0RP commented on Dec 15, 2025

    @R44VC0RP
    Contributor

    Good call, going to get those added in 0.20.0.

  2. self-assigned this
    on Dec 15, 2025
  3. R44VC0RP commented on Dec 21, 2025

    @R44VC0RP
    Contributor

    Fixed in PR #27 (0.20.0 release). Added the following exports:

    Types:

    • InboundWebhookPayload - Complete webhook payload structure
    • InboundEmail, InboundEmailAddress, InboundEmailAddressField
    • InboundAttachment, InboundParsedEmailData, InboundCleanedContent
    • InboundEndpointInfo

    Functions:

    • isInboundWebhookPayload() - Type guard for payload validation
    • verifyWebhook() - Verify webhook by endpoint ID and token
    • verifyWebhookFromHeaders() - Verify webhook using request headers

    Usage:

    import { Inbound, verifyWebhookFromHeaders, type InboundWebhookPayload } from 'inboundemail'
    
    const inbound = new Inbound(process.env.INBOUND_API_KEY!)
    
    export async function POST(request: Request) {
      const isValid = await verifyWebhookFromHeaders(request.headers, inbound)
      
      if (!isValid) {
        return new Response('Unauthorized', { status: 401 })
      }
      
      const payload: InboundWebhookPayload = await request.json()
      console.log(`Received verified email: ${payload.email.subject}`)
      
      return new Response('OK', { status: 200 })
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions