Architecture overview
At its core, the Apps framework uses an event-driven architecture that enables real-time communication between your app and Thena. Here’s how the main components work together:Core components
-
Event system
- Central communication layer
- Handles real-time updates
- Manages app lifecycle events
- Processes user interactions
-
Authentication
- Bot token-based authentication
- Secure installation flow
- Automatic token management
-
Authorization
- Permission-based access control
- Scoped resource access
- User-level permissions
-
Events
- Subscribe to platform events
- Publish custom events
- Handle real-time updates
- Process state changes
-
Activities
- HTTP-based operations
- Pre-configured API calls
- Custom business logic
- External service integration
How events work
The event system is the primary way your app communicates with Thena. Here’s a typical event flow:Key events
-
Installation events
When your app is installed in a workspace, you’ll receive an installation event with the bot token and other details:
-
Platform events
Your app can subscribe to various platform events. Here’s an example of a ticket comment event:
Security model
The Apps framework uses a token-based security model:-
Installation security
- Secure bot token generation
- Workspace-scoped access
-
Request authentication
- Token validation on each request
- Request signing
- Secure payload transmission
-
Data access control
- Resource-level permissions
- User context validation
- Data encryption in transit