A Grispi plugin that integrates with TSoft e-commerce platform, allowing customer service agents to quickly lookup customers and their order history directly within the Grispi ticket interface.
- Customer Search: Search customers by name, email, phone number, or customer code
- Automatic Detection: Automatically search using the requester's phone number when available
- Customer Details: View comprehensive customer information including contact details
- Order History: Browse complete order history with status, totals, and dates
- Order Details: Access full order information including line items and shipping data
{
"title": "TSoft",
"src": "https://grispi.app/tsoft-side-plugin/build/",
"uiDefinition": {
"height": 900
},
"singleton": false,
"lazy": true
}{}- Clone this repository
- Install dependencies:
yarn install
To test the application within Grispi, run:
yarn startThe application will be available at http://localhost:3000.
yarn buildThe plugin integrates with TSoft's API with the following main endpoints:
- GET /customer/getCustomers: Search for customers using various fields
- GET /order/get: Retrieve order details for a specific customer
The integration uses the token provided by the Grispi context for authentication.
src/api/: API integration with TSoftsrc/components/: Reusable UI componentssrc/contexts/: Context providers for state managementsrc/screens/: Main application screenssrc/store/: MobX stores for state management
The GrispiClient.instance() initialization code is as follows:
useEffect(() => {
GrispiClient.instance()
._init()
.then((data: GrispiBundle) => {
setTicket(data.context.ticket);
setSettings(data.settings);
setLoading(false);
GrispiClient.instance().activeTicketChanged = function (ticket: Ticket) {
setTicket(ticket);
};
})
.catch((err) => {
console.error({ err });
});
}, []);If you want to test outside of Grispi, make sure to comment out the GrispiClient.instance() block in the contexts/grispi-context.tsx file.
- When a ticket is opened, the plugin automatically searches for the customer using the requester's phone number
- Agents can also manually search for customers using the search form
- Selecting a customer shows their details and order history
- Clicking on an order displays the complete order details
- React - UI framework
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Shadcn/UI - UI component library
- MobX - State management
- React Hot Toast - Toast notifications