Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

2.0 KB
Raw Blame
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import {
  createPiece,
  PieceAuth,
  Property,
} from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import {
  anonymizePerson,
  createEvent,
  createEventsBatch,
  createPurchase,
  createPurchasesBatch,
  findCoupon,
  findPerson,
  getLoyaltyRedeemActions,
  refund,
  unsubscribePerson,
  updatePerson,
  updateReferralStatus,
  claimOffer,
} from './lib/actions';
import { TALKABLE_API_URL } from './lib/common/constants';

const markdownDescription = `
Follow these steps:

1. **Log in to your Talkable account:** Open Talkable https://www.talkable.com/login.

2. **Enter the Talkable site slug and API key:** Go to **All site Settings** > **API Settings**, and copy Site ID and API key.

`;

export const talkableAuth = PieceAuth.CustomAuth({
  description: markdownDescription,
  props: {
    site: Property.ShortText({
      displayName: 'Talkable site ID',
      required: true,
    }),
    api_key: Property.ShortText({
      displayName: 'API key',
      required: true,
    }),
  },
  required: true,
});

export const talkable = createPiece({
  displayName: 'Talkable',
  description: 'Referral marketing programs that drive revenue',

  auth: talkableAuth,
  minimumSupportedRelease: '0.30.0',
  logoUrl:
    'https://www.talkable.com/wp-content/uploads/2021/12/talkable-favicon.svg',
  authors: ["Vitalini","kishanprmr","MoShizzle","abuaboud"],
  categories: [PieceCategory.MARKETING],
  actions: [
    findPerson,
    findCoupon,
    updatePerson,
    anonymizePerson,
    unsubscribePerson,
    createPurchase,
    createPurchasesBatch,
    createEvent,
    createEventsBatch,
    refund,
    getLoyaltyRedeemActions,
    updateReferralStatus,
    claimOffer,
    createCustomApiCallAction({
      baseUrl: () => TALKABLE_API_URL,
      auth: talkableAuth,
      authMapping: async (auth) => ({
        Authorization: `Bearer ${auth.props.api_key}`,
      }),
    }),
  ],
  triggers: [],
});