-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📝 Add env WHATSAPP_CLOUD_API_URL to possible change https://gr… #1170
📝 Add env WHATSAPP_CLOUD_API_URL to possible change https://gr… #1170
Conversation
@clairton is attempting to deploy a commit to the Typebot Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe recent updates involve the integration of an environment variable, Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- apps/builder/src/features/whatsapp/getPhoneNumber.ts (1 hunks)
- apps/builder/src/features/whatsapp/getSystemTokenInfo.ts (1 hunks)
- apps/builder/src/pages/api/typebots/[typebotId]/whatsapp/media/[mediaId].ts (1 hunks)
Additional comments: 3
apps/builder/src/features/whatsapp/getPhoneNumber.ts (1)
- 25-25: The use of
process.env.WHATSAPP_CLOUD_API_URL
with a fallback to'https://graph.facebook.com'
is implemented correctly. However, ensure that the environment variable is documented and properly configured in all deployment environments to avoid service disruption.apps/builder/src/features/whatsapp/getSystemTokenInfo.ts (1)
- 31-31: The dynamic URL construction using
process.env.WHATSAPP_CLOUD_API_URL
with a fallback is implemented correctly. Ensure that the environment variable is documented and properly configured in all deployment environments to avoid service disruption.apps/builder/src/pages/api/typebots/[typebotId]/whatsapp/media/[mediaId].ts (1)
- 64-64: The dynamic URL construction using
process.env.WHATSAPP_CLOUD_API_URL
with a fallback is implemented correctly. Ensure that the environment variable is documented and properly configured in all deployment environments to avoid service disruption.
@clairton Refactored this to use the in-house env lib and to list it in the configuration docs. Let me know if you're OK to merge this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (6)
- apps/builder/src/features/whatsapp/getPhoneNumber.ts (2 hunks)
- apps/builder/src/features/whatsapp/getSystemTokenInfo.ts (2 hunks)
- apps/builder/src/pages/api/typebots/[typebotId]/whatsapp/media/[mediaId].ts (2 hunks)
- apps/docs/self-hosting/configuration.mdx (1 hunks)
- packages/bot-engine/whatsapp/sendWhatsAppMessage.ts (2 hunks)
- packages/env/env.ts (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- apps/builder/src/features/whatsapp/getPhoneNumber.ts
- apps/builder/src/features/whatsapp/getSystemTokenInfo.ts
- apps/builder/src/pages/api/typebots/[typebotId]/whatsapp/media/[mediaId].ts
Additional comments: 4
packages/bot-engine/whatsapp/sendWhatsAppMessage.ts (2)
- 6-6: The import of
env
from@typebot.io/env
is correct and aligns with the PR objectives to use environment variables for configuration.- 20-20: The usage of
env.WHATSAPP_CLOUD_API_URL
in the URL construction is a good practice for configurability. However, ensure that theenv
module provides a valid URL and that the application handles cases where the environment variable might be missing or invalid.packages/env/env.ts (1)
- 286-290: The addition of
WHATSAPP_CLOUD_API_URL
with a default value ensures backward compatibility and prevents failures in case the environment variable is not set. This is a good practice.apps/docs/self-hosting/configuration.mdx (1)
- 241-247: The documentation update to include
WHATSAPP_CLOUD_API_URL
is necessary for informing users about the new environment variable. It's important to keep documentation in sync with code changes.
@baptisteArno awesome, thank's! |
cd2cc43
to
11664f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (6)
- apps/builder/src/features/whatsapp/getPhoneNumber.ts (2 hunks)
- apps/builder/src/features/whatsapp/getSystemTokenInfo.ts (2 hunks)
- apps/builder/src/pages/api/typebots/[typebotId]/whatsapp/media/[mediaId].ts (2 hunks)
- apps/docs/self-hosting/configuration.mdx (1 hunks)
- packages/bot-engine/whatsapp/sendWhatsAppMessage.ts (2 hunks)
- packages/env/env.ts (1 hunks)
Files skipped from review as they are similar to previous changes (5)
- apps/builder/src/features/whatsapp/getSystemTokenInfo.ts
- apps/builder/src/pages/api/typebots/[typebotId]/whatsapp/media/[mediaId].ts
- apps/docs/self-hosting/configuration.mdx
- packages/bot-engine/whatsapp/sendWhatsAppMessage.ts
- packages/env/env.ts
Additional comments: 2
apps/builder/src/features/whatsapp/getPhoneNumber.ts (2)
- 8-8: Import of
env
from@typebot.io/env
added.The addition of the
{ env }
import from@typebot.io/env
is consistent with the PR's objective to use an environment variable for the WhatsApp Cloud API URL.
- 26-26: Usage of
env.WHATSAPP_CLOUD_API_URL
in API URL construction.The dynamic construction of the API URL using
env.WHATSAPP_CLOUD_API_URL
is implemented correctly and falls back to a default value if not set, which aligns with the PR's objectives.
refs #1117 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Dynamically construct API URLs for WhatsApp features using environment variables for improved reliability and configurability. - Updated `sendWhatsAppMessage` function to use `env.WHATSAPP_CLOUD_API_URL` for URL construction, allowing for more dynamic configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
…isteArno#1170) refs baptisteArno#1117 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Dynamically construct API URLs for WhatsApp features using environment variables for improved reliability and configurability. - Updated `sendWhatsAppMessage` function to use `env.WHATSAPP_CLOUD_API_URL` for URL construction, allowing for more dynamic configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
refs #1117
Summary by CodeRabbit
sendWhatsAppMessage
function to useenv.WHATSAPP_CLOUD_API_URL
for URL construction, allowing for more dynamic configuration.