Profile Icon Agent is an AI-powered service that automatically detects faces in images, crops and resizes them with proper padding, and returns a processed image URL. The service integrates with Telex to send processed image notifications.
- Uses AI for face detection via Imagga API.
- Crops and resizes images with padding for optimal profile photos.
- Uploads processed images to Cloudinary.
- Returns a shareable URL for the cropped image.
- Integrates with Telex for notifications.
- Node.js (Express.js)
- TypeScript
- Cloudinary (Image Storage)
- Imagga API (Face Detection)
- Telex (Messaging & Notification Service)
- Sharp (Image Processing)
- Axios (HTTP Requests)
- Dotenv (Environment Variables)
- Node.js installed
- Cloudinary account (for image storage)
- Imagga API credentials (for face detection)
- Ngrok (if testing locally with Telex webhook)
- Clone the repository:
git clone https://github.com/telexintegrations/telin-profile-icon-agent.git cd profile-icon-agent - Install dependencies:
npm install
- Create a
.envfile and add the following:PORT=3000 CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret IMAGGA_API_KEY=your_imagga_api_key IMAGGA_API_SECRET=your_imagga_api_secret
- Start the server:
npm run dev
Endpoint: GET /api/v1/integration-config
Response:
{
"app_name": "Profile Icon Agent",
"app_description": "A service that crops and resizes user profile photos using face detection and returns the processed image URL."
}Endpoint: POST /api/v1/target-url
Request Body:
{
"message": "/image https://example.com/sample.jpg"
}Response:
{
"message": "Success"
}- A user sends an image URL with the
/imagecommand. - The service extracts the image URL.
- Imagga API detects faces in the image.
- The image is cropped and resized with padding.
- The processed image is uploaded to Cloudinary.
- A response with the processed image URL is sent to Telex.
- Invalid or missing image URLs return
400 Bad Request. - If no face is detected, the response includes an error message.
- Failed Cloudinary uploads return
500 Internal Server Error.
- Fork the repository.
- Create a feature branch (
git checkout -b feature-branch). - Commit changes (
git commit -m "Add new feature"). - Push to branch (
git push origin feature-branch). - Open a Pull Request.
This project is licensed under the MIT License.
For any questions or contributions, reach out to mailto:[email protected] or mailto:[email protected].