Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
67a0d54
Merge pull request #6 from triggerdotdev/dev
matt-aitken Jan 20, 2023
1c62f16
Merge remote-tracking branch 'origin/dev'
matt-aitken Jan 20, 2023
b45a5c6
Merge remote-tracking branch 'origin/dev'
matt-aitken Jan 21, 2023
ce8d146
Merge pull request #7 from triggerdotdev/dev
matt-aitken Jan 23, 2023
63776c7
Merge pull request #8 from triggerdotdev/dev
ericallam Jan 23, 2023
4085ad9
Merge pull request #12 from triggerdotdev/dev
matt-aitken Jan 24, 2023
f10dadb
Fixed Toast widths
samejr Jan 25, 2023
80ebc1b
Merge pull request #13 from triggerdotdev/dev
matt-aitken Jan 25, 2023
88306d6
Removed private beta message at the start of the README
matt-aitken Jan 25, 2023
5ea825f
Merge pull request #14 from triggerdotdev/dev
matt-aitken Jan 26, 2023
94f2de8
Merge pull request #15 from triggerdotdev/dev
matt-aitken Jan 26, 2023
ea9a839
Merge pull request #16 from triggerdotdev/dev
matt-aitken Jan 26, 2023
3710f99
Merge pull request #17 from triggerdotdev/dev
matt-aitken Jan 26, 2023
7faf431
Merge pull request #18 from triggerdotdev/dev
ericallam Jan 26, 2023
fb6d254
Merge pull request #19 from triggerdotdev/dev
ericallam Jan 26, 2023
e8dfa4b
Merge pull request #20 from triggerdotdev/dev
ericallam Jan 26, 2023
519293c
Merge pull request #21 from triggerdotdev/dev
ericallam Jan 26, 2023
6bc46a8
Merge pull request #22 from triggerdotdev/dev
ericallam Jan 26, 2023
a1b1640
Merge pull request #23 from triggerdotdev/dev
ericallam Jan 26, 2023
56e5a5c
Merge pull request #24 from triggerdotdev/dev
matt-aitken Jan 28, 2023
ef149bd
Merge pull request #25 from triggerdotdev/dev
matt-aitken Jan 28, 2023
26c1c9f
Merge pull request #26 from triggerdotdev/dev
matt-aitken Jan 28, 2023
c954b37
Merge pull request #27 from triggerdotdev/dev
matt-aitken Jan 28, 2023
92391c4
Merge pull request #28 from triggerdotdev/dev
matt-aitken Jan 28, 2023
d6512b2
Revert "Merge pull request #28 from triggerdotdev/dev"
matt-aitken Jan 28, 2023
888c8a7
Revert "Merge pull request #27 from triggerdotdev/dev"
matt-aitken Jan 28, 2023
35aedad
Revert "Merge pull request #26 from triggerdotdev/dev"
matt-aitken Jan 28, 2023
ba617fa
Revert "Merge pull request #25 from triggerdotdev/dev"
matt-aitken Jan 28, 2023
416c46d
Revert "Merge pull request #24 from triggerdotdev/dev"
matt-aitken Jan 28, 2023
95d5944
Revert "Revert "Merge pull request #24 from triggerdotdev/dev""
matt-aitken Jan 28, 2023
0137dac
Revert "Revert "Merge pull request #25 from triggerdotdev/dev""
matt-aitken Jan 28, 2023
1fc7020
Revert "Revert "Merge pull request #26 from triggerdotdev/dev""
matt-aitken Jan 28, 2023
3e9e743
Revert "Revert "Merge pull request #27 from triggerdotdev/dev""
matt-aitken Jan 28, 2023
251b64c
Revert "Revert "Merge pull request #28 from triggerdotdev/dev""
matt-aitken Jan 28, 2023
5423d54
Merge pull request #29 from triggerdotdev/dev
matt-aitken Jan 28, 2023
0f18780
Merge pull request #30 from triggerdotdev/dev
matt-aitken Jan 29, 2023
c1b9aee
Merge pull request #31 from triggerdotdev/dev
ericallam Jan 29, 2023
da948c4
Merge pull request #32 from triggerdotdev/dev
matt-aitken Jan 29, 2023
4c23370
Merge pull request #33 from triggerdotdev/dev
matt-aitken Jan 29, 2023
4adad00
Fixed typo
samejr Jan 29, 2023
8372cf7
Fixed a dead link in the docs
samejr Jan 29, 2023
f660810
Added 2 more integration logos
D-K-P Jan 29, 2023
36cdf50
Removed dead link
samejr Jan 29, 2023
0141643
Updated the github docs example
samejr Jan 29, 2023
b129381
Improved docs title for github star example
samejr Jan 29, 2023
b8dc408
Title improvement
samejr Jan 29, 2023
c1ca53f
Typo
samejr Jan 29, 2023
23fc242
Typo
samejr Jan 29, 2023
c96f9f1
Rename Reference to SDK Reference
ericallam Jan 29, 2023
6c3c991
Make it easier to start ngrok in different regions
ericallam Jan 29, 2023
a015e53
Added github star example to the docs
D-K-P Jan 30, 2023
e226194
Added openapi spec doc and a reference page for the POST /events endp…
ericallam Jan 30, 2023
3f9e7f4
Cleanup the github stars example
ericallam Jan 30, 2023
d71c61f
Break out github into it’s own package
ericallam Jan 30, 2023
2bb7bad
Breakout slack into it’s own package
ericallam Jan 30, 2023
09142ce
Moved internal only dependencies to devDependencies
ericallam Jan 30, 2023
5f517a5
Breakout resend into it’s own package
ericallam Jan 30, 2023
fad8f44
Breakout shopify into it’s own package
ericallam Jan 30, 2023
6c027c3
Remove trigger-providers, trigger-integrations, and internal-integrat…
ericallam Jan 30, 2023
89d38c0
Added changesets for the new packages
ericallam Jan 30, 2023
064e27f
Update all the docs for the new packages
ericallam Jan 30, 2023
fd54c86
Updated s-webapp watch paths
ericallam Jan 30, 2023
3496053
Updated the CLI to point at the internal integrations metadata
matt-aitken Jan 30, 2023
7b29422
Initial setup on new WhatsApp integration
matt-aitken Jan 31, 2023
4fb9091
Merge branch 'dev' into integrations/whatsapp
matt-aitken Jan 31, 2023
a20a26e
Updated settings for WhatsApp to match other integration packages
matt-aitken Jan 31, 2023
a4a64af
Make the generic webhook input fields readonly so to get rid of React…
matt-aitken Jan 31, 2023
3dd0af6
Installed @trigger.dev/whatsapp
matt-aitken Jan 31, 2023
24b57e0
Added support for verifying webhooks, with WhatsApp working
matt-aitken Jan 31, 2023
6e8d9b4
WIP on webhook verification
matt-aitken Jan 31, 2023
c578891
Removed webhook payload validation
matt-aitken Jan 31, 2023
950138b
More work on WhatsApp messages
matt-aitken Jan 31, 2023
9a52949
WhatsApp text messages are coming through
matt-aitken Jan 31, 2023
6acda31
Added lots of message types to the schemas
matt-aitken Jan 31, 2023
c1511f2
Match the connection using the slug
matt-aitken Feb 1, 2023
69004cd
Revert "Match the connection using the slug"
matt-aitken Feb 1, 2023
dbfff6b
WhatsApp send template message
matt-aitken Feb 1, 2023
b3bc70b
Instead of switch statement, grab the integrations object
matt-aitken Feb 1, 2023
421bd9f
Fixed broken integration creation route
ericallam Jan 31, 2023
8124930
Fixed call to getIntegrations in new workflow route
ericallam Jan 31, 2023
e6d1ddc
Remove exports and add main and types to package.json
ericallam Jan 31, 2023
e6ce7ea
WhatsApp basic template message is sending
matt-aitken Feb 1, 2023
868e5f4
Changed the WhatsApp package exports to match the other integrations
matt-aitken Feb 1, 2023
afc47d3
Send “text” WhatsApp messages
matt-aitken Feb 1, 2023
4054571
Metadata required for the run page
matt-aitken Feb 1, 2023
d57339a
Reactions and replying is working
matt-aitken Feb 1, 2023
c1742f0
Sending images working
matt-aitken Feb 1, 2023
731b630
Sending locations is working
matt-aitken Feb 1, 2023
93f1814
Improved errors handling, added sendContacts
matt-aitken Feb 1, 2023
6442576
Added audio, video, document and sticker messages
matt-aitken Feb 1, 2023
f46436b
Added “prettier-plugin-tailwindcss”: correct order for classes
matt-aitken Feb 1, 2023
e281297
Merge remote-tracking branch 'origin/dev' into integrations/whatsapp
matt-aitken Feb 1, 2023
3126d89
Added a WhatsApp example
matt-aitken Feb 1, 2023
2232788
Added message event docs
matt-aitken Feb 1, 2023
2eea62c
Added lots of the docs for messages
matt-aitken Feb 1, 2023
b8b032a
Added docs for contact messages and template messages
matt-aitken Feb 2, 2023
aefbba1
Added an index page to the reference
matt-aitken Feb 2, 2023
42c2a87
Improved the text
matt-aitken Feb 2, 2023
49a4b0c
Removed changeset files that pulled from dev
matt-aitken Feb 2, 2023
7e1c04a
Removed console.log
matt-aitken Feb 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/docs/examples/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ You can use these workflows in your product by following the instructions on eac
<Card title="Resend" icon="envelope" href="/examples/resend">
Create a welcome email drip campaign.
</Card>
<Card title="WhatsApp" icon="whatsapp" href="/examples/whatsapp">
Listen for WhatsApp messages and reply.
</Card>
</CardGroup>
48 changes: 48 additions & 0 deletions apps/docs/examples/whatsapp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "WhatsApp"
sidebarTitle: "WhatsApp"
description: "Here are some example workflows you could create using the WhatsApp integration."
---

For more information about the WhatsApp integration, check out the [integration page](/integrations/apis/whatsapp).

## Listen for WhatsApp messages and reply

Integrations required: WhatsApp

```ts
import { Trigger } from "@trigger.dev/sdk";
import { events, sendReaction, sendText } from "@trigger.dev/whatsapp";

new Trigger({
id: "whatsapp-webhook",
name: "Listen for WhatsApp messages and reply",
apiKey: "<my_api_key>",
//this listens for all WhatsApp messages sent to your WhatsApp Business account
on: events.messageEvent({
accountId: "<your_account_id>",
}),
run: async (event, ctx) => {
//these logs will appear on the run page
await ctx.logger.info(`Message data`, event.message);
await ctx.logger.info(`Phone number`, event.contacts[0]);

//add a 🥰 reaction to the original message
const reactionResponse = await sendReaction("reaction", {
fromId: event.metadata.phone_number_id,
to: event.message.from,
isReplyTo: event.message.id,
emoji: "🥰",
});

//send a text message in response
const textResponse = await sendText("text-msg", {
fromId: event.metadata.phone_number_id,
to: event.message.from,
text: "Hello! This is a text sent automatically from https://www.trigger.dev",
});

//we support all other types of WhatsApp messages (audio, video, document, location, etc)
},
}).listen();
```
94 changes: 94 additions & 0 deletions apps/docs/integrations/apis/whatsapp/actions/audio-message.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
title: "Send Audio Message"
sidebarTitle: "Audio Message"
description: "Post a audio message to WhatsApp"
---

Send WhatsApp audio messages from your WhatsApp Business Account.

## Params

<ParamField path="key" type="string" required={true}>
A unique string. Please see the [Keys and Resumability](/guides/resumability)
doc for more info.
</ParamField>

<ParamField path="message" type="object" required={true}>
<Expandable title="properties" defaultOpen={true}>
<ParamField path="fromId" type="string" required={false}>
The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
</ParamField>

<ParamField path="to" type="string" required={false}>
The phone number you want to send the message to.
</ParamField>

<ParamField path="url" type="string" required={true}>
The url of the audio file to be sent.
</ParamField>

<ParamField path="isReplyTo" type="string" required={false}>
Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
</ParamField>

</Expandable>
</ParamField>

## Response

<ResponseField name="contacts" type="object">
The contact information of who received the message
</ResponseField>

<ResponseField name="messages" type="object">
An array of message ids that were sent
</ResponseField>

<ResponseField name="messaging_product" type="string">
Always `whatsapp`
</ResponseField>

## Example Workflows

### Notify Slack on New GitHub Star

<CodeGroup>

```typescript Automated reply to WhatsApp messages
import { Trigger } from "@trigger.dev/sdk";
import { events, sendAudio } from "@trigger.dev/whatsapp";

new Trigger({
id: "demo",
on: events.messageEvent({
accountId: "<account_id>",
}),
run: async (event, ctx) => {
//send an automatic audio reply to the message
const audioResponse = await sendAudio("audio", {
fromId: event.metadata.phone_number_id,
to: event.message.from,
url: "https://ssl.gstatic.com/dictionary/static/pronunciation/2022-03-02/audio/wi/wikipedia_en_gb_1.mp3",
});
},
}).listen();
```

```json Example response
{
"contacts": [
{
"input": "12345678901",
"wa_id": "12345678901"
}
],
"messages": [
{
"id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
}
],
"messaging_product": "whatsapp"
}
```

</CodeGroup>
103 changes: 103 additions & 0 deletions apps/docs/integrations/apis/whatsapp/actions/contacts-message.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: "Send a Contacts Message"
sidebarTitle: "Contacts Message"
description: "Post a contacts message to WhatsApp"
---

Send WhatsApp contacts messages from your WhatsApp Business Account.

## Params

<ParamField path="key" type="string" required={true}>
A unique string. Please see the [Keys and Resumability](/guides/resumability)
doc for more info.
</ParamField>

<ParamField path="message" type="object" required={true}>
<Expandable title="properties" defaultOpen={true}>
<ParamField path="fromId" type="string" required={false}>
The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
</ParamField>

<ParamField path="to" type="string" required={false}>
The phone number you want to send the message to.
</ParamField>

<ParamField path="contacts" type="object" required={true}>
An array of contacts to be sent.
</ParamField>

</Expandable>
</ParamField>

## Response

<ResponseField name="contacts" type="object">
The contact information of who received the message
</ResponseField>

<ResponseField name="messages" type="object">
An array of message ids that were sent
</ResponseField>

<ResponseField name="messaging_product" type="string">
Always `whatsapp`
</ResponseField>

## Example Workflows

### Notify Slack on New GitHub Star

<CodeGroup>

```typescript Automated reply to WhatsApp messages
import { Trigger } from "@trigger.dev/sdk";
import { events, sendVideo } from "@trigger.dev/whatsapp";

new Trigger({
id: "demo",
on: events.messageEvent({
accountId: "<account_id>",
}),
run: async (event, ctx) => {
//send an contacts message
const contactsResponse = await sendContacts("contacts", {
fromId: event.metadata.phone_number_id,
to: event.message.from,
contacts: [
{
name: {
first_name: "Matt",
last_name: "Aitken",
formatted_name: "Matt Aitken",
},
phones: [
{
phone: "+12345678901",
},
],
},
],
});
},
}).listen();
```

```json Example response
{
"contacts": [
{
"input": "12345678901",
"wa_id": "12345678901"
}
],
"messages": [
{
"id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
}
],
"messaging_product": "whatsapp"
}
```

</CodeGroup>
99 changes: 99 additions & 0 deletions apps/docs/integrations/apis/whatsapp/actions/document-message.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: "Send Document Message"
sidebarTitle: "Document Message"
description: "Post a document message to WhatsApp"
---

Send WhatsApp document messages from your WhatsApp Business Account.

## Params

<ParamField path="key" type="string" required={true}>
A unique string. Please see the [Keys and Resumability](/guides/resumability)
doc for more info.
</ParamField>

<ParamField path="message" type="object" required={true}>
<Expandable title="properties" defaultOpen={true}>
<ParamField path="fromId" type="string" required={false}>
The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
</ParamField>

<ParamField path="to" type="string" required={false}>
The phone number you want to send the message to.
</ParamField>

<ParamField path="url" type="string" required={true}>
The url of the document to be sent.
</ParamField>

<ParamField path="caption" type="string" required={false}>
Optional caption that sits below the video
</ParamField>

<ParamField path="isReplyTo" type="string" required={false}>
Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
</ParamField>

</Expandable>
</ParamField>

## Response

<ResponseField name="contacts" type="object">
The contact information of who received the message
</ResponseField>

<ResponseField name="messages" type="object">
An array of message ids that were sent
</ResponseField>

<ResponseField name="messaging_product" type="string">
Always `whatsapp`
</ResponseField>

## Example Workflows

### Notify Slack on New GitHub Star

<CodeGroup>

```typescript Automated reply to WhatsApp messages
import { Trigger } from "@trigger.dev/sdk";
import { events, sendDocument } from "@trigger.dev/whatsapp";

new Trigger({
id: "demo",
on: events.messageEvent({
accountId: "<account_id>",
}),
run: async (event, ctx) => {
//send an automatic document reply to the message
const documentResponse = await sendDocument("doc", {
fromId: event.metadata.phone_number_id,
to: event.message.from,
url: "https://upload.wikimedia.org/wikipedia/commons/2/20/Re_example.pdf",
caption: "A pdf for you",
});
},
}).listen();
```

```json Example response
{
"contacts": [
{
"input": "12345678901",
"wa_id": "12345678901"
}
],
"messages": [
{
"id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
}
],
"messaging_product": "whatsapp"
}
```

</CodeGroup>
Loading