@@ -7,7 +7,7 @@ Send and receive SMS messages in your Convex app using Twilio.
77
88``` ts
99import Twilio from " @convex-dev/twilio" ;
10- import { components } from " ./_generated/server.js " ;
10+ import { components } from " ./_generated/api " ;
1111
1212export const twilio = new Twilio (components .twilio , {
1313 default_from: process .env .TWILIO_PHONE_NUMBER ! ,
@@ -45,9 +45,9 @@ npm install @convex-dev/twilio
4545Create 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
4949import { defineApp } from " convex/server" ;
50- import twilio from " @convex-dev/twilio/convex.config.js " ;
50+ import twilio from " @convex-dev/twilio/convex.config" ;
5151
5252const app = defineApp ();
5353app .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
6969import Twilio from " @convex-dev/twilio" ;
70- import { components } from " ./_generated/server.js " ;
70+ import { components } from " ./_generated/api " ;
7171
7272export 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, {
163163twilio .incomingMessageCallback = internal .example .handleIncomingMessage ;
164164
165165export 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