Toolkit Version Support for Triggers
Summary
Added toolkit version support to trigger operations (create and getType) in both Python and TypeScript SDKs. This allows users to explicitly specify which toolkit version to use when creating trigger instances and retrieving trigger type information, ensuring consistent behavior across different toolkit versions.
Trigger operations now respect the global toolkitVersions configuration set during Composio initialization, providing better control over which trigger versions are used in your applications.
Key Changes
TypeScript SDK (ts/packages/core/)
- Added
toolkit_versionsparameter totriggers.create()method- Passes the global toolkit versions configuration when creating trigger instances
- Defaults to
'latest'when no version is specified
- Modified
triggers.getType()to respect global toolkit versions- Now accepts toolkit version configuration to fetch trigger types for specific versions
- Improved error messages to include version-related fixes
- Updated trigger type documentation with comprehensive examples
- Added behavior documentation explaining version usage patterns
Python SDK (python/composio/core/models/)
- Added
toolkit_versionsparameter totriggers.create()method- Uses global toolkit version configuration when creating trigger instances
- Converts
Nonetoomitfor API compatibility
- Modified
triggers.get_type()to respect toolkit versions- Implemented custom method replacing direct client binding
- Passes toolkit version configuration to API calls
- Added comprehensive docstrings explaining version behavior
Behavior
Creating Triggers with Toolkit Versions:
Retrieving Trigger Types with Specific Versions:
Benefits
- Version Control: Explicitly specify which toolkit version to use for triggers
- Consistency: Ensure trigger behavior remains consistent across toolkit updates
- Testing: Test trigger integrations with specific versions before updating
- Debugging: Easier to debug issues by pinning to specific toolkit versions
- Production Safety: Avoid unexpected changes from automatic version updates
Migration Guide
This is a non-breaking change. Existing code will continue to work with default behavior:
Before (still works):
After (recommended for production):
For more details on toolkit versioning, see the Toolkit Versioning documentation.