@openpets/sprinklr
v1.0.0
Published
Sprinklr plugin for OpenPets - Manage customer cases, social listening, content publishing, and campaign operations through the Sprinklr API. Supports case management, outbound posts, listening queries, and more.
Maintainers
Readme
Sprinklr Plugin for OpenPets
A plugin for integrating with the Sprinklr Unified Customer Experience Management (CXM) platform through OpenCode.
Overview
This plugin provides access to Sprinklr's comprehensive API, enabling you to:
- Case Management: Create, update, search, and manage customer support cases
- Social Listening: Monitor social media mentions, keywords, and brand conversations
- Outbound Publishing: Schedule and manage social media posts
- Conversations: Search and analyze customer interactions across channels
Features
Core Tools (Manually Implemented)
sprinklr-test-connection- Verify API connectivitysprinklr-search-cases- Search and filter casessprinklr-get-case- Get case details by IDsprinklr-create-case- Create new support casessprinklr-update-case- Update existing casessprinklr-list-listening-topics- List monitoring topicssprinklr-search-conversations- Search social conversationssprinklr-list-outbound-posts- View scheduled/draft posts
Auto-Generated Tools (from OpenAPI Spec)
After running pets generate-openapi, additional tools will be available for:
- Campaign management
- Custom fields
- Content briefs
- Extensions
- Macros
- And 200+ more endpoints
Setup
1. Get Sprinklr API Access
- Visit https://dev.sprinklr.com
- Register as a developer (requires Sprinklr account)
- Create a new application
- Generate API credentials
- Exchange API key/secret for a Bearer token via the authorization endpoint
2. Configure Environment Variables
Copy .env.example to .env and add your credentials:
cp .env.example .envEdit .env:
SPRINKLR_API_TOKEN=your_bearer_token_here
SPRINKLR_ENV=prod3. Install Dependencies
cd pets/sprinklr
bun install4. Generate OpenAPI Tools (Optional)
To generate additional tools from the OpenAPI spec:
pets generate-openapi --verboseUsage
Testing Connection
opencode run "test sprinklr connection"Common Queries
# Search for cases
opencode run "search for cases assigned to me"
# Get case details
opencode run "get details for case 12345"
# Create a new case
opencode run "create a new support case for customer inquiry about billing"
# List listening topics
opencode run "list all listening topics"
# Search conversations
opencode run "search conversations mentioning our brand in the last week"
# List outbound posts
opencode run "list scheduled outbound posts"API Details
- Base URL:
https://api3.sprinklr.com - Authentication: Bearer Token (JWT)
- API Version: 2.0
- OpenAPI Spec: Available at Sprinklr Developer Portal
- Endpoints: 264+ available operations
Authentication
Sprinklr uses Bearer Token authentication. Pass your token in the Authorization header:
Authorization: Bearer <your_jwt_token>Environments
Sprinklr supports multiple environments:
prod- Production (default)prod0,prod2,prod3, etc. - Other production instances
Set via SPRINKLR_ENV environment variable.
Development
Project Structure
pets/sprinklr/
├── index.ts # Main plugin with core tools
├── package.json # Plugin configuration with OpenAPI spec
├── opencode.json # OpenCode configuration
├── .env.example # Environment template
├── openapi-client.ts # Generated client (after generate-openapi)
├── openapi-tools.ts # Generated tools (after generate-openapi)
└── README.md # This fileAdding Custom Tools
Edit index.ts to add custom tools. Follow the existing pattern:
{
name: "sprinklr-my-custom-tool",
description: "Description of what this tool does",
schema: z.object({
param: z.string().describe("Parameter description")
}),
async execute(args) {
// Implementation
}
}Testing
Run test scenarios defined in package.json:
# Test connection
bun run test:connection
# Test case search
bun run test:search-cases
# Test listening topics
bun run test:list-topicsTroubleshooting
"Not Configured" Error
Ensure SPRINKLR_API_TOKEN is set in your .env file or environment.
Connection Failed
- Verify your API token is valid and not expired
- Check you're using the correct environment (
prodvs others) - Ensure your Sprinklr account has API access enabled
Rate Limiting
Sprinklr APIs may have rate limits. Check response headers for:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset
Resources
License
MIT - See repository for details
