Skip to content

Commit

Permalink
feat(whatsapp): update auth
Browse files Browse the repository at this point in the history
  • Loading branch information
kishanprmr committed Jun 18, 2024
1 parent 1bbf4a5 commit ba712db
Show file tree
Hide file tree
Showing 5 changed files with 392 additions and 259 deletions.
30 changes: 14 additions & 16 deletions packages/pieces/community/whatsapp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

import { createPiece, PieceAuth, Property } from "@activepieces/pieces-framework";
import { sendMessage } from "./lib/actions/send-message";
import { sendMedia } from "./lib/actions/send-media";
import { sendFromTemplate } from "./lib/actions/send-from-template";
import {
createPiece,
PieceAuth,
Property,
} from '@activepieces/pieces-framework';
import { sendMessage } from './lib/actions/send-message';
import { sendMedia } from './lib/actions/send-media';
import { sendFromTemplate } from './lib/actions/send-from-template';

const markdown = `
To Obtain a Phone Number ID and a Permanent System User Access Token, follow these steps:
Expand All @@ -12,7 +15,7 @@ To Obtain a Phone Number ID and a Permanent System User Access Token, follow the
3. Choose Business as the type of app.
4. Add new Product -> WhatsApp.
5. Navigate to WhatsApp Settings > API Setup.
6. Select a phone number and copy its Phone number ID.
6. Copy the Business Account ID.
7. Login to your [Meta Business Manager](https://business.facebook.com/).
8. Click on Settings.
9. Create a new System User with access over the app and copy the access token.
Expand All @@ -24,12 +27,8 @@ export const whatsappAuth = PieceAuth.CustomAuth({
props: {
access_token: PieceAuth.SecretText({
displayName: 'System User Access Token',
description: 'The system user access token of your WhatsApp business account',
required: true,
}),
phoneNumberId: Property.ShortText({
displayName: 'Phone Number ID',
description: 'The phone number ID of your WhatsApp business account',
description:
'The system user access token of your WhatsApp business account',
required: true,
}),
businessAccountId: Property.ShortText({
Expand All @@ -40,14 +39,13 @@ export const whatsappAuth = PieceAuth.CustomAuth({
},
});


export const whatsapp = createPiece({
displayName: "WhatsApp Business",
displayName: 'WhatsApp Business',
description: 'Manage your WhatsApp business account',
auth: whatsappAuth,
minimumSupportedRelease: '0.20.0',
logoUrl: "https://cdn.activepieces.com/pieces/whatsapp.png",
authors: ["LevwTech"],
logoUrl: 'https://cdn.activepieces.com/pieces/whatsapp.png',
authors: ['LevwTech'],
actions: [sendMessage, sendMedia, sendFromTemplate],
triggers: [],
});
Loading

0 comments on commit ba712db

Please sign in to comment.