@openpets/crisp
v1.0.1
Published
Access Crisp conversations, send messages, manage contacts, and handle customer support chats through the Crisp API
Maintainers
Readme
Crisp Plugin for OpenCode
Access Crisp conversations, send messages, manage contacts, and handle customer support chats through the Crisp API.
Prerequisites
- A Crisp account with API access
- Plugin token credentials (identifier and key)
Setup
1. Install Dependencies
npm install2. Get API Credentials
- Go to Crisp Settings > Tokens
- Create a new plugin token
- Copy the identifier and key
3. Configure Environment
cp .env.example .envEdit .env with your credentials:
CRISP_IDENTIFIER=your-plugin-identifier
CRISP_KEY=your-plugin-key
CRISP_WEBSITE_ID=your-website-id # Optional default4. Find Your Website ID
Your website ID is a UUID like 8c842203-7ed8-4e29-a608-7cf78a7d2fcc. Find it in:
- Your Crisp dashboard URL
- Settings > Website Settings
Available Tools
crisp-list-conversations
List conversations for a Crisp website.
Parameters:
websiteId(optional): Website ID (uses env if not provided)page(optional): Page number for pagination (default: 1)
Example:
opencode run "list all conversations from crisp"crisp-get-conversation
Get details of a specific conversation.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation ID
Example:
opencode run "get conversation session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"crisp-get-messages
Get messages from a conversation.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation IDtimestampBefore(optional): Timestamp for pagination
Example:
opencode run "get messages from conversation session_abc123"crisp-send-message
Send a message in a conversation.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation IDcontent(required): Message contenttype(optional): Message type (text, file, note, etc.)from(optional): Sender type (operator or user)
Example:
opencode run "send 'Hello, how can I help?' to conversation session_abc123"crisp-get-conversation-metas
Get metadata for a conversation.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation ID
crisp-update-conversation-metas
Update metadata for a conversation.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation IDnickname(optional): User nicknameemail(optional): User emailphone(optional): User phonesegments(optional): Tags/segments arraydataJson(optional): Custom data as JSON string, e.g.'{"key": "value"}'
crisp-change-conversation-state
Change the state of a conversation.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation IDstate(required): New state -pending,unresolved, orresolved
Example:
opencode run "resolve conversation session_abc123"crisp-create-conversation
Create a new conversation.
Parameters:
websiteId(optional): Website ID
crisp-list-people
List people profiles (end-users/contacts).
Parameters:
websiteId(optional): Website IDpage(optional): Page numbersearchText(optional): Search filter
crisp-get-person
Get a person's profile.
Parameters:
websiteId(optional): Website IDpeopleId(required): Person ID or email
crisp-get-routing-assign
Get conversation routing assignment.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation ID
crisp-assign-conversation
Assign a conversation to an operator.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation IDuserId(required): Operator user ID
crisp-mark-messages-read
Mark messages as read.
Parameters:
websiteId(optional): Website IDsessionId(required): Session/conversation IDfingerprints(required): Array of message fingerprintsfrom(optional): Who is marking as read
crisp-list-operators
List all operators for a website.
Parameters:
websiteId(optional): Website ID
crisp-get-website
Get website details.
Parameters:
websiteId(optional): Website ID
Using from Other Projects
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"/path/to/pets/crisp/index.ts"
]
}Conversation States
Crisp conversations have three states:
- pending: Waiting for first response
- unresolved: Active conversation in progress
- resolved: Conversation completed
Error Handling
All tools return JSON responses:
// Success
{
"success": true,
"data": { ... }
}
// Error
{
"success": false,
"error": "Error message"
}API Reference
This plugin uses the official crisp-api Node.js wrapper. See the Crisp REST API Reference for full API documentation.
License
MIT
