This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
This template includes built-in support for analytics and error monitoring through PostHog and Sentry. Both services are optional and can be enabled or disabled through environment variables and configuration.
All analytics and monitoring features can be controlled in the src/config.ts
file:
const config = {
auth: {
enabled: true,
},
payments: {
enabled: true,
},
analytics: {
posthog: {
enabled: process.env.NEXT_PUBLIC_POSTHOG_KEY ? true : false,
apiKey: process.env.NEXT_PUBLIC_POSTHOG_KEY,
apiHost: process.env.NEXT_PUBLIC_POSTHOG_HOST || 'https://app.posthog.com',
},
},
monitoring: {
sentry: {
enabled: process.env.NEXT_PUBLIC_SENTRY_DSN ? true : false,
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
},
},
};
PostHog provides product analytics, session recording, feature flags, and more.
To enable PostHog:
- Create a PostHog account and project at PostHog.com
- Add your API key to the
.env
file:NEXT_PUBLIC_POSTHOG_KEY=phc_your_api_key
- Optionally set a custom host with
NEXT_PUBLIC_POSTHOG_HOST
To disable PostHog:
- Simply leave the
NEXT_PUBLIC_POSTHOG_KEY
empty in your.env
file
Sentry provides error tracking, performance monitoring, and more.
To enable Sentry:
- Create a Sentry account and project at Sentry.io
- Add your DSN to the
.env
file:NEXT_PUBLIC_SENTRY_DSN=https://your-dsn-url
- For source map uploads, add:
SENTRY_AUTH_TOKEN
,SENTRY_ORG
, andSENTRY_PROJECT
To disable Sentry:
- Simply leave the
NEXT_PUBLIC_SENTRY_DSN
empty in your.env
file
To test Sentry integration, visit the /sentry-example-page
route in your application, which includes buttons to trigger test errors.