docs[minor]: Swap gtag for supabase (#18937)

Added deps:
- `@supabase/supabase-js` - for sending inserts
- `supabase` - dev dep, for generating types via cli
- `dotenv` for loading env vars

Added script:
- `yarn gen` - will auto generate the database schema types using the
supabase CLI. Not necessary for development, but is useful. Requires
authing with the supabase CLI (will error out w/ instructions if you're
not authed).

Added functionality:
- pulls users IP address (using a free endpoint: `https://api.ipify.org`
so we can filter out abuse down the line)

TODO:
- [x] add env vars to vercel
This commit is contained in:
Brace Sproul
2024-03-11 14:23:12 -07:00
committed by GitHub
parent 5c2f7e6b2b
commit 4ff6aa5c78
8 changed files with 274 additions and 15840 deletions

View File

@@ -4,7 +4,7 @@
// Note: type annotations allow type checking and IDEs autocompletion
// eslint-disable-next-line import/no-extraneous-dependencies
const { ProvidePlugin } = require("webpack");
const path = require("path");
require("dotenv").config();
const baseLightCodeBlockTheme = require("prism-react-renderer/themes/vsLight");
const baseDarkCodeBlockTheme = require("prism-react-renderer/themes/vsDark");
@@ -335,12 +335,13 @@ const config = {
src: "https://www.googletagmanager.com/gtag/js?id=G-9B66JQQH2F",
async: true,
},
{
src: "https://www.googletagmanager.com/gtag/js?id=G-WFT0J048RF",
async: true,
}
],
customFields: {
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY:
process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY,
NEXT_PUBLIC_SUPABASE_URL: process.env.NEXT_PUBLIC_SUPABASE_URL,
},
};
module.exports = config;