ServerExtensions
Overview
Host and execute tenant-scoped extension actions, publish bundles securely, and secure access via short-lived tokens.
The Extensions feature is the primary extensibility vector for Selegic CRM. It allows the system to host third-party frontend code and execute custom server-side logic within a secure, multi-tenant context.
Core Concepts
| Concept | Description |
|---|---|
| Actions | Pre-defined server-side functions callable by extensions or flows |
| Extensions | Bundled frontend applications served through a private proxy |
| Tokens | Short-lived JWTs authorizing extensions to call the Action API |
| Artifacts | Physical assets (HTML, JS, CSS) making up an extension |
Key Components
| Component | File | Purpose |
|---|---|---|
ActionHandler | services/action-handlers.ts | Action dispatch and execution |
TokenService | helpers/token-helpers.ts | JWT issuance and verification |
ArtifactService | services/artifact-service.ts | GCS upload/download and serving |
DispatchService | services/dispatch.ts | Action routing and validation |
File Structure
features/extensions/
├── services/
│ ├── action-handlers.ts # Action execution
│ ├── artifact-service.ts # GCS asset management
│ └── dispatch.ts # Action routing
├── helpers/
│ ├── token-helpers.ts # Token generation/verification
│ ├── installation-resolver.ts
│ └── action-parsers.ts
├── cli-html/ # CLI HTML templates
└── types/Quick Navigation
- Action Runtime — Action definitions and execution
- Token Security — JWT issuance and verification
- Artifact Service — GCS storage and asset serving
- Publish Flow — CLI packaging and deployment
- Runbook — Troubleshooting
Architecture
Why Extensions
Selegic is designed as a platform. Standard CRUD and Flows cover ~90% of use cases, but complex enterprise integrations require:
- Custom UI components (embedded in CRM)
- Specialized processing logic
- Third-party integrations
Extensions provide a sandboxed way to add these capabilities without modifying core server code.