Customize Component
Connector Icon and Category
-
Find an Icon:
- Search for a suitable user interface icon for your component in
.svgformat.
- Search for a suitable user interface icon for your component in
-
Save the Icon:
- Place the icon in the following directory:
server/libs/modules/components/newcomponent/src/main/resources/assets/newcomponent.svg.
- Place the icon in the following directory:
-
Choose a Category:
- Select a category for your component. Available categories can be found in ComponentCategory.
-
Update Component Handler:
- In
NewComponentComponentHandler, override themodifyComponent(ModifiableComponentDefinition modifiableComponentDefinition)method:@Override public ModifiableComponentDefinition modifyComponent(ModifiableComponentDefinition modifiableComponentDefinition) { return modifiableComponentDefinition .icon("path:assets/newcomponent.svg") .categories(ComponentCategory.HELPERS); }
- In
Connection
If your component requires custom authentication parameters, override the modifyConnection(ModifiableConnectionDefinition modifiableConnectionDefinition) method in NewComponentComponentHandler.
Refer to examples like ShopifyComponentHandler, DiscordComponentHandler, or PipelinerComponentHandler for guidance.
Action
If some actions require properties not specified in the OpenAPI schema, override the modifyActions(ModifiableActionDefinition... actionDefinitions) method in NewComponentComponentHandler.
Refer to examples like DiscordComponentHandler or ClickupComponentHandler.
Dynamic Options
- Define Dynamic Options in OpenAPI Schema:
- Add
x-dynamic-options: trueto the parameter in your OpenAPI schema to indicate that it requires dynamic options. - If the dynamic options depend on another parameter, include
x-dynamic-options-dependencywith the relevant parameter name.
- Add
- Regenerate the Component:
- Run the following command to regenerate the component with updated dynamic options:
./bytechef.sh component init --open-api-path ../../server/libs/modules/components/newcomponent/openapi.yaml --output-path ../../server/libs/modules/components --name newcomponent
- Run the following command to regenerate the component with updated dynamic options:
- For each parameter with dynamic
options, the options() andoptionsLookupDependsOn()methods are automatically generated in theModifiableActionDefinitionclass. - The
AbstractNewComponentUtilsclass is generated, providing methods to retrieve dynamic options for various properties within the component. - Override the appropriate method in the
NewComponentUtilsclass to load the correct options based on your specific requirements.
For implementation details, refer to examples from existing components such as Shopify, Airtable, and Hubspot.
Dynamic Properties
- Define Dynamic Properties in OpenAPI Schema:
- Add
x-dynamic-properties: trueto the parameter in your OpenAPI schema to mark it as dynamic. - If the dynamic property depends on another parameter, include
x-dynamic-properties-dependencywith the relevant parameter name.
- Add
- Regenerate the Component:
- Run the following command to regenerate the component with updated dynamic properties:
./bytechef.sh component init --open-api-path ../../server/libs/modules/components/newcomponent/openapi.yaml --output-path ../../server/libs/modules/components --name newcomponent
- Run the following command to regenerate the component with updated dynamic properties:
- For each dynamic property, the
properties()andpropertiesLookupDependsOn()methods are generated in theModifiableActionDefinitionclass. - The
AbstractNewComponentUtilsclass is generated, offering methods to retrieve dynamic properties for various parameters within the component. - Override the necessary method in the
NewComponentUtilsclass to load the correct properties based on your specific needs.
For implementation details, refer to examples from existing components such as Airtable.
Dynamic Output
- Define Dynamic Output in OpenAPI Schema:
- Add
x-dynamic-output: trueto the response in your OpenAPI schema to indicate that output is fully dynamic.
- Add
For implementation details, refer to examples from existing components such as Airtable.
AI Agent Tool
- Define the AI Agent Tool in OpenAPI Schema:
- Add
x-ai-agent-tool: trueto the individual endpoint in your OpenAPI schema to indicate that it is an AI Agent Tool.
- Add
- Regenerate the Component:
- Run the following command to regenerate the component:
./bytechef.sh component init --open-api-path ../../server/libs/modules/components/newcomponent/openapi.yaml --output-path ../../server/libs/modules/components --name newcomponent ``
For implementation details, refer to examples from existing components such as Airtable.