/ apps / web / next.config.js
next.config.js
 1  const { withSentryConfig } = require('@sentry/nextjs');
 2  
 3  const allowedBots =
 4    '.*(bot|telegram|baidu|bing|yandex|iframely|whatsapp|facebook).*';
 5  
 6  /** @type {import('next').NextConfig} */
 7  const nextConfig = {
 8    headers() {
 9      return [
10        {
11          headers: [
12            { key: 'X-Content-Type-Options', value: 'nosniff' },
13            { key: 'X-XSS-Protection', value: '1; mode=block' },
14            { key: 'Referrer-Policy', value: 'strict-origin' }
15          ],
16          source: '/(.*)'
17        }
18      ];
19    },
20    reactStrictMode: false,
21    redirects() {
22      return [
23        {
24          destination: '/?signup=true',
25          permanent: false,
26          source: '/signup'
27        },
28        {
29          destination: 'https://discord.com/invite/B8eKhSSUwX',
30          permanent: true,
31          source: '/discord'
32        },
33        {
34          destination:
35            'https://explorer.gitcoin.co/#/round/42161/25/1?utm_source=hey.xyz',
36          permanent: true,
37          source: '/gitcoin'
38        },
39        // Forms
40        {
41          destination:
42            'https://hey.height.app/?taskForm=Token-Allowlist-Request-mwarXOg6ks0A',
43          permanent: true,
44          source: '/-/token-request'
45        },
46        {
47          destination: 'https://tana.pub/EltxDvrSt3Yn/hey-changelog',
48          permanent: true,
49          source: '/-/changelog'
50        },
51        {
52          destination:
53            'https://plugins.crisp.chat/urn:crisp.im:contact-form:0/contact/37355035-47aa-4f42-ad47-cffc3d1fea16',
54          permanent: true,
55          source: '/support'
56        },
57        {
58          destination:
59            'https://yoginth.notion.site/ff1926a080fa44bc9d40ee534f627949',
60          permanent: true,
61          source: '/-/mod-guide'
62        }
63      ];
64    },
65    rewrites() {
66      return [
67        {
68          destination: `${process.env.NEXT_PUBLIC_OG_URL}/u/:match*`,
69          has: [{ key: 'user-agent', type: 'header', value: allowedBots }],
70          source: '/u/:match*'
71        },
72        {
73          destination: `${process.env.NEXT_PUBLIC_OG_URL}/posts/:match*`,
74          has: [{ key: 'user-agent', type: 'header', value: allowedBots }],
75          source: '/posts/:match*'
76        }
77      ];
78    },
79    transpilePackages: ['data']
80  };
81  
82  module.exports = withSentryConfig(
83    nextConfig,
84    { org: 'heyverse', project: 'web', silent: true },
85    {
86      automaticVercelMonitors: true,
87      disableLogger: true,
88      hideSourceMaps: true,
89      transpileClientSDK: true,
90      tunnelRoute: '/monitoring',
91      widenClientFileUpload: true
92    }
93  );