Create Integration Definition
This tutorial will guide you through the process of creating a Gelato integration with an action that fetches random icecream flavor and trigger that fetches new icecream flavor created. It assumes that you are familiar with the following:
- Staqr Local development Or GitHub Codespaces.
- TypeScript syntax.
Integration Definition
To get started, let's generate a new integration for Gelato
npm run cli integrations create
You will be asked three questions to define your new integration:
Integration Name: Specify a name for your integration. This name uniquely identifies your integration within the Staqr ecosystem.Package Name: Optionally, you can enter a name for the npm package associated with your integration. If left blank, the default name will be used.Integration Type: Choose the integration type based on your intention. It can be either "custom" if it's a tailored solution for your needs, or "community" if it's designed to be shared and used by the broader community.
Example:
npm run cli integrations create
? Enter the integration name: gelato
? Enter the package name: @staqr/integration-gelato
? Select the integration type: community
The integration will be generated at packages/integrations/community/gelato/,
the src/index.ts file should contain the following code
import { PieceAuth, createPiece } from '@staqr/integrations-framework';
export const gelato = createPiece({
displayName: 'Gelato',
logoUrl: 'https://cdn.staqr.com/integrations/gelato.png',
auth: PieceAuth.None(),
authors: [],
actions: [],
triggers: [],
});