Skip to content

Commit 57d3bb6

Browse files
authored
Merge pull request #7 from get-convex/pashabitz/address-comments
readme
2 parents f5a559a + e5ddf7a commit 57d3bb6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Send and receive SMS messages in your Convex app using Twilio.
77

88
```ts
99
import Twilio from "@convex-dev/twilio";
10-
import { components } from "./_generated/server.js";
10+
import { components } from "./_generated/api";
1111

1212
export const twilio = new Twilio(components.twilio, {
1313
default_from: process.env.TWILIO_PHONE_NUMBER!,
@@ -45,9 +45,9 @@ npm install @convex-dev/twilio
4545
Create a `convex.config.ts` file in your app's `convex/` folder and install the component by calling `use`:
4646

4747
```ts
48-
// convex/convex.config.js
48+
// convex/convex.config.ts
4949
import { defineApp } from "convex/server";
50-
import twilio from "@convex-dev/twilio/convex.config.js";
50+
import twilio from "@convex-dev/twilio/convex.config";
5151

5252
const app = defineApp();
5353
app.use(twilio);
@@ -67,7 +67,7 @@ Instantiate a Twilio Component client in a file in your app's `convex/` folder:
6767
```ts
6868
// convex/example.ts
6969
import Twilio from "@convex-dev/twilio";
70-
import { components } from "./_generated/server.js";
70+
import { components } from "./_generated/api";
7171

7272
export const twilio = new Twilio(components.twilio, {
7373
// optionally pass in the default "from" phone number you'll be using
@@ -163,7 +163,9 @@ const twilio = new Twilio(components.twilio, {
163163
twilio.incomingMessageCallback = internal.example.handleIncomingMessage;
164164

165165
export const handleIncomingMessage = internalMutation({
166-
args: messageValidator,
166+
args: {
167+
message: messageValidator,
168+
},
167169
handler: async (ctx, message) => {
168170
// Use ctx here to update the database or schedule other actions.
169171
// This is in the same transaction as the component's message insertion.

0 commit comments

Comments
 (0)