This tutorial will guide you through the process of creating a Gelato hub 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:

Hub Definition

To get started, let’s generate a new hub for Gelato
npm run cli hubs create
You will be asked three questions to define your new hub:
  1. Hub Name: Specify a name for your hub. This name uniquely identifies your hub within the ActiveHub ecosystem.
  2. Package Name: Optionally, you can enter a name for the npm package associated with your hub. If left blank, the default name will be used.
  3. Hub Type: Choose the hub 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 hubs create

? Enter the hub name: gelato
? Enter the package name: @flo/hub-gelato
? Select the hub type: community
The hub will be generated at packages/hubs/community/gelato/, the src/index.ts file should contain the following code
import { HubAuth, createHub } from '@flo/hubs-framework';

export const gelato = createHub({
  displayName: 'Gelato',
  logoUrl: 'https://cdn.andaihub.ai/flo/hubs/gelato.png',
  auth: HubAuth.None(),
  authors: [],
  actions: [],
  triggers: [],
});