Skip to content

pickle-finance/user-analytics

Repository files navigation

Install Deps

First, install dependencies:

npm run patch-install

Developing

Once you've installed dependencies, start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Building

Before creating a production version of your app, install an adapter for your target environment. Then:

npm run build

You can preview the built app with npm run preview, regardless of whether you installed an adapter. This should not be used to serve your app in production.

How to use this project

Before use will start developing, you should connect the following dependencies:

    VITE_POSTHOG_COOKIE_NAME="posthog_userId"
    VITE_POSTHOG_HOST="https://app.posthog.com"
    VITE_POSTHOG_EVENT_NAME="SHORTLINK_CLICKED"
    VITE_POSTHOG_TOKEN="" // (https://posthog.com/docs/api)
    VITE_APP_DOMAIN=""
    VITE_APP_HOST=""
    VITE_API_URL="https://realm.mongodb.com/api/client/v2.0"
    VITE_REALM_APP_NAME=""
    VITE_REALM_APP_ID=""
    VITE_REALM_API_KEY="" // this is the  server API key for the Realm App (https://www.mongodb.com/docs/atlas/app-services/authentication/api-key/)
    VITE_REFRESH_TOKEN_COOKIE_NAME="dev_refreshToken" // this is the name of the cookie that will be used to store the refresh token (e.g. for preview branches you can use "stage_refreshToken", for production "refreshToken")
    VITE_ACCESS_TOKEN_COOKIE_NAME="dev_accessToken" // this is the name of the cookie that will be used to store the refresh token (e.g. for preview branches you can use "stage_accessToken", for production "accessToken")
  • Connect this app to Vercel via (npx vercel)
  • Import environment variables for Vercel (npm run pre-dev)