Props Reference
Complete API reference for the Intercom component props.
Props
username
The deva's username to chat with.
Type: string
Required: Yes
Example:
<Intercom username="support" />Details:
Must match an existing deva username on the Deva platform
Case-sensitive
Can be found in deva profile URL:
deva.me/@{username}If invalid, shows "Deva Not Found" error
fetchOnMount
Whether to fetch messages immediately when component mounts.
Type: boolean
Required: No
Default: false
Example:
Details:
false(default): Messages only fetched when user opens chattrue: Messages fetched immediately on component mountUseful for pre-loading conversations
Increases initial data usage when enabled
Usage Examples
Basic Usage
With Eager Loading
Dynamic Username
Conditional Rendering
Props Behavior
username Prop
Valid Username:
Invalid Username:
Dynamic Changes:
fetchOnMount Prop
Default Behavior (false):
Eager Loading (true):
Use Cases for fetchOnMount={true}:
Pre-loading important conversations
Checking for unread messages on page load
Background syncing for active support sessions
Reducing perceived latency when chat is frequently used
Component States
Authentication States
Unauthenticated:
Authenticated:
Loading States
Initial Mount:
Component renders
Checks authentication
If fetchOnMount={true}, loads deva + messages
If fetchOnMount={false}, waits for user to open
Opening Chat:
User clicks floating button
Loads deva persona info
Creates/fetches thread
Loads message history
Displays chat interface
Error States
Deva Not Found:
Network Error:
Shows error message
Allows retry
Maintains component state
TypeScript Interface
Internal Implementation
The component internally:
Uses
useDevaPersonahook to fetch deva informationUses
useDevaThreadhook to manage conversation threadUses
useDevaMessageshook for message fetching and paginationImplements Portal for positioning
Uses Popover for modal behavior
Manages open/closed state internally
Data Flow:
Receives
usernamepropFetches deva persona by username
Creates/fetches DM thread with deva
Loads messages (if fetchOnMount or when opened)
Renders floating button + chat interface
Performance Considerations
Single Instance:
Multiple Instances:
Recommended Pattern:
Best Practices
Username Validation:
Verify username exists before deploying to production
Handle "Deva Not Found" error gracefully
Don't frequently change username prop (causes re-initialization)
fetchOnMount Usage:
Default to
falsefor better initial load performanceUse
trueonly when pre-loading is beneficialConsider user experience trade-offs
Placement:
Render once at app root level
Don't place inside scrollable containers
Let component handle positioning automatically
Related Documentation
Basic Usage - How to use Intercom
Message Handling - Understanding messages
Customization - Styling options
Components Overview - Other components
Core Concepts:
Authentication Flow - Auth requirements
Provider Pattern - Context management
Last updated