Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions app/[lang]/_components/ChatwootWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ export function ChatwootWidget({ nonce }: { nonce?: string }): ReactElement {

console.log('[ChatwootWidget] Chatwoot SDK found, initializing')
window.chatwootSDK.run({
websiteToken: '', // Gets set by the backend proxy
baseUrl: '/api/chatwoot',
websiteToken: process.env.NEXT_PUBLIC_CHATWOOT_API_KEY ?? '',
baseUrl: 'https://app.chatwoot.com',
})
window.chatwootSDK.isLoaded = true
setIsInitialized(true)
Expand Down Expand Up @@ -255,7 +255,7 @@ export function ChatwootWidget({ nonce }: { nonce?: string }): ReactElement {
return (
<Script
id={'chatwoot-sdk'}
src={'/api/chatwoot/packs/js/sdk.js'}
src={'https://app.chatwoot.com/packs/js/sdk.js'}
strategy={'afterInteractive'}
defer
async
Expand Down
135 changes: 0 additions & 135 deletions app/api/chatwoot/[...path]/route.ts

This file was deleted.

3 changes: 1 addition & 2 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,8 @@ export const config = {
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico, sitemap.xml, robots.txt
* - chatwoot (now handled by API route)
* - public assets with extensions (images, fonts, etc.)
*/
'/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|chatwoot|.*\\.(?:svg|png|jpg|jpeg|gif|webp|webmanifest|ico|css|js|woff|woff2|ttf|otf)).*)',
'/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|.*\\.(?:svg|png|jpg|jpeg|gif|webp|webmanifest|ico|css|js|woff|woff2|ttf|otf)).*)',
],
}
16 changes: 0 additions & 16 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ const nextConfig = {
source: '/(.*)',
headers: [{key: 'cross-origin-resource-policy', value: 'cross-origin'}]
},
{
// Specific headers for Chatwoot proxy to ensure iframe compatibility
source: '/chatwoot/(.*)',
headers: [
{key: 'cross-origin-embedder-policy', value: 'credentialless'},
{key: 'cross-origin-resource-policy', value: 'cross-origin'},
{key: 'cross-origin-opener-policy', value: 'same-origin'},
{key: 'x-frame-options', value: 'SAMEORIGIN'}
]
},
{
// Allow Onramper iframe on /trade
source: '/trade',
Expand All @@ -54,12 +44,6 @@ const nextConfig = {
}
]
},
async rewrites() {
return [
{source: '/chatwoot/:path*', destination: '/api/chatwoot/:path*'},
{source: '/api/v1/:path*', destination: '/api/chatwoot/api/v1/:path*'}
]
},
async redirects() {
return [
// Redirects from old blog posts to new blog posts
Expand Down