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

746 B
Raw Blame
import { PieceAuth, Property } from '@activepieces/pieces-framework';

export const websocketCommon = {
  connectionType: "websocket",
  auth: PieceAuth.CustomAuth({
    required: true,
    props: {
      proxyBaseUrl: Property.ShortText({
        displayName: 'AnyHook Server URL',
        description: 'The URL of your AnyHook server',
        required: true,
        defaultValue: 'http://10.0.0.101:3001'
      }),
    },
  }),
  apiCall: async function (
    url: string,
    method: string,
    data: object | undefined = undefined
  ) {
    const response = await fetch(url, {
      method,
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(data),
    });
    return response.json();
  },
};