@coasy/piece-coasy
v0.1.18
Published
This is the Coasy integration piece for Activepieces, providing actions and triggers to interact with the Coasy platform for funnel and webinar management.
Keywords
Readme
Coasy Piece for Activepieces
This is the Coasy integration piece for Activepieces, providing actions and triggers to interact with the Coasy platform for funnel and webinar management.
Overview
The Coasy piece includes:
- Actions: Create funnel participants
- Triggers: New funnel participants, new webinar participants, new auth events
- Authentication: Custom auth with base URL and API key
Development Setup
Prerequisites
- Clone the activepieces repository
- Install dependencies:
npm install - Ensure you're in the root directory of the activepieces monorepo
Development Commands
Building the Piece
# Build the coasy piece specifically
nx build pieces-coasy
# Build with watch mode for development
nx build pieces-coasy --watchTesting
# Run tests for the coasy piece
nx test pieces-coasy
# Run tests with watch mode
nx test pieces-coasy --watchLinting
# Lint the coasy piece
nx lint pieces-coasy
# Auto-fix lint issues
nx lint pieces-coasy --fixDevelopment Workflow
1. Start Development Environment
# Start the full development environment (frontend + backend + engine + pieces)
npm run dev
# Or start just backend services if only testing the piece
npm run dev:backend2. Testing Your Changes
- Navigate to
http://localhost:4200(frontend) - Create a new flow and add Coasy actions/triggers
- Test authentication with your Coasy credentials
- Verify actions and triggers work as expected
3. Adding New Features
Adding a New Action:
- Create a new file in
src/lib/actions/ - Export the action from
src/index.ts - Follow the existing patterns in
create-funnel-participant.ts
Adding a New Trigger:
- Create a new file in
src/lib/triggers/ - Export the trigger from
src/index.ts - Follow the existing patterns in
new-funnel-participant.ts
4. File Structure
packages/pieces/community/coasy/
├── README.md # This file
├── package.json # Package configuration
├── project.json # Nx project configuration
├── tsconfig.json # TypeScript config
└── src/
├── index.ts # Main piece definition and exports
└── lib/
├── actions/ # Action implementations
├── triggers/ # Trigger implementations
└── common/ # Shared utilitiesCode Standards
Authentication
The piece uses custom authentication with:
baseUrl: Coasy instance base URLapiKey: API key for authentication
Error Handling
- Use proper error messages for user-facing errors
- Handle API errors gracefully
- Validate inputs before making API calls
Properties
- Use descriptive
displayNameanddescriptionfor all properties - Mark required fields appropriately
- Use proper property types from
@activepieces/pieces-framework
Testing in Activepieces
Authentication Testing:
- Verify connection works with valid credentials
- Test error handling with invalid credentials
Action Testing:
- Test with valid inputs
- Test error scenarios
- Verify data transformation
Trigger Testing:
- Set up webhooks/polling as needed
- Test trigger conditions
- Verify payload structure
Publishing
The piece is published as @coasy/piece-coasy to npm. Version is currently 0.0.13.
To publish a new version:
- Update the
versioninpackage.jsonin Coasy community folder (e.g., from0.0.13to0.0.14) - Build the package with:
npm run build-piece coasy - Navigate to the dist folder, where is the output:
cd dist/packages/pieces/community/coasy - Here check the content, delete tgz and publish directly to npm
npm publishNote: The monorepo's npm run publish-piece script currently has dependency resolution issues. Use the direct npm publish method above instead.
