<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Integrations on BonsAI Documentation</title>
    <link>/docs/integrations/</link>
    <description>Recent content in Integrations on BonsAI Documentation</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <atom:link href="/docs/integrations/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Email Integration</title>
      <link>/docs/integrations/email/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/docs/integrations/email/</guid>
      <description>&lt;h1 id=&#34;email-integration&#34;&gt;&#xA;  Email Integration&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#email-integration&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;p&gt;BonsAI allows users to submit documents via email. The system uses Postfix as the SMTP server to receive emails, extracts attachments, and processes them through the document pipeline.&lt;/p&gt;&#xA;&lt;h2 id=&#34;overview&#34;&gt;&#xA;  Overview&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#overview&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The email integration provides:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Document Ingestion via Email&lt;/strong&gt;: Users can email documents directly to BonsAI&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Extraction Type Routing&lt;/strong&gt;: Email address tags determine document type (AP bills, AR invoices, etc.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Attachment Processing&lt;/strong&gt;: Only attachments are extracted and imported as documents&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Sender Whitelisting&lt;/strong&gt;: Entity-level control over allowed senders&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Deduplication&lt;/strong&gt;: Prevents reprocessing of duplicate emails&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;TLS Encryption&lt;/strong&gt;: Let&amp;rsquo;s Encrypt certificates for secure email transport&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;architecture&#34;&gt;&#xA;  Architecture&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#architecture&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Email arrives on SMTP (port 25)&#xA;         ↓&#xA;    Postfix MTA&#xA;         ↓&#xA;  tofu-postfix (Rust)&#xA;         ↓&#xA; ┌───────┴───────┐&#xA; │               │&#xA;Redis         S3 (raw email)&#xA;(dedup)          │&#xA;                 ↓&#xA;            RabbitMQ&#xA;                 ↓&#xA;       bonsai-trigger-sync&#xA;                 ↓&#xA;    ┌────────────┴────────────┐&#xA;    │                         │&#xA;PostgreSQL              S3 (documents)&#xA;(Document records)      (Attachment files)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;components&#34;&gt;&#xA;  Components&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#components&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Component&lt;/th&gt;&#xA;          &lt;th&gt;Location&lt;/th&gt;&#xA;          &lt;th&gt;Purpose&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;tofu-postfix&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;apps/tofu-postfix/&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;SMTP server that receives and parses emails&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;bonsai-trigger-sync&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;apps/bonsai-trigger-sync/&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Worker that processes emails and creates documents&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Deployment&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;deployment/resources/tofu-postfix/&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Kubernetes manifests&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h2 id=&#34;email-address-format&#34;&gt;&#xA;  Email Address Format&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#email-address-format&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Users must send emails to a specially formatted address:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Intercom Integration</title>
      <link>/docs/integrations/intercom/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/docs/integrations/intercom/</guid>
      <description>&lt;h1 id=&#34;intercom-integration&#34;&gt;&#xA;  Intercom Integration&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#intercom-integration&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;p&gt;BonsAI automatically syncs user and organization data to Intercom for customer communication and support. This integration runs through our Clerk webhook handler, ensuring all user and organization changes are reflected in Intercom in real-time.&lt;/p&gt;&#xA;&lt;h2 id=&#34;overview&#34;&gt;&#xA;  Overview&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#overview&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The Intercom integration provides:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Automatic User Sync&lt;/strong&gt;: Users are created/updated in Intercom when they join organizations&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Organization Sync&lt;/strong&gt;: Organizations are synced as companies in Intercom&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Invitation Tracking&lt;/strong&gt;: Invited users appear in Intercom before they accept invitations&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;User-Company Associations&lt;/strong&gt;: Users are properly associated with their organizations&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Deletion Sync&lt;/strong&gt;: Deleted users and organizations are removed from Intercom&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;architecture&#34;&gt;&#xA;  Architecture&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#architecture&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Clerk Events → BonsAPI Webhook → Intercom API&#xA;                    ↓&#xA;                Database&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;data-flow&#34;&gt;&#xA;  Data Flow&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#data-flow&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;user-creationupdate&#34;&gt;&#xA;  User Creation/Update&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#user-creationupdate&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;User signs up or updates profile in Clerk&lt;/li&gt;&#xA;&lt;li&gt;Clerk sends webhook to BonsAPI&lt;/li&gt;&#xA;&lt;li&gt;BonsAPI updates database&lt;/li&gt;&#xA;&lt;li&gt;BonsAPI syncs user to Intercom with organization associations&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;organization-creationupdate&#34;&gt;&#xA;  Organization Creation/Update&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#organization-creationupdate&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Organization created/updated in Clerk&lt;/li&gt;&#xA;&lt;li&gt;Clerk sends webhook to BonsAPI&lt;/li&gt;&#xA;&lt;li&gt;BonsAPI updates database&lt;/li&gt;&#xA;&lt;li&gt;BonsAPI creates/updates company in Intercom&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;user-invitations&#34;&gt;&#xA;  User Invitations&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#user-invitations&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Admin invites user via BonsAPI&lt;/li&gt;&#xA;&lt;li&gt;Invitation created in Clerk&lt;/li&gt;&#xA;&lt;li&gt;BonsAPI creates &amp;ldquo;invited&amp;rdquo; contact in Intercom&lt;/li&gt;&#xA;&lt;li&gt;When user accepts, invited contact is converted to active user&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;configuration&#34;&gt;&#xA;  Configuration&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#configuration&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;environment-variables&#34;&gt;&#xA;  Environment Variables&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#environment-variables&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Required in deployment.yaml&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;INTERCOM_ACCESS_TOKEN&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;your_intercom_access_token&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ENVIRONMENT_NAME&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;production  &lt;span style=&#34;color:#75715e&#34;&gt;# or development, staging&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;deployment&#34;&gt;&#xA;  Deployment&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#deployment&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;The Intercom integration is configured in:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
