mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
This PR allows us to feature flag on the frontend, this means we can rollout features in stages, hide features, do AB testing etc. ### Changes 🏗️ Added a LaunchDarkly Provider Added a withFeatureFlag component Added two env vars for: - enabling LD - specifying the _public_ client side key Usage: ``` 'use client' import { useFlags } from 'launchdarkly-react-client-sdk' import { withFeatureFlag } from '@/components/feature-flag/with-feature-flag' function TestFlagPage() { const flags = useFlags() return ( <div className="p-4"> <h1>If you can see this, the feature flag is ON</h1> <pre>Current flag value: {JSON.stringify(flags, null, 2)}</pre> </div> ) } export default withFeatureFlag(TestFlagPage, 'test-flag') ``` ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: <!-- Put your test plan here: --> - [ ] ... <details> <summary>Test plan</summary> - Set LD to false - Navigate to a test page, should not be visible - Set LD to true - Navigate to same test page, should be visible </details> #### For configuration changes: - [x] `.env.example` is updated or already compatible with my changes - [x] I have included a list of my configuration changes in the PR description (under **Changes**) - [x] I have updated infra repo <details> <summary>Examples of configuration changes</summary> - Changing ports - Adding new services that need to communicate with each other - Secrets or environment variable changes - New or infrastructure changes such as databases </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Bently <tomnoon9@gmail.com> Co-authored-by: SerchioSD <69461657+serchiosd@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com> Co-authored-by: Zamil Majdy <zamil.majdy@agpt.co> Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co> Co-authored-by: Reinier van der Leer <pwuts@agpt.co> Co-authored-by: Toran Bruce Richards <toran.richards@gmail.com>
22 lines
1.1 KiB
Plaintext
22 lines
1.1 KiB
Plaintext
NEXT_PUBLIC_AUTH_CALLBACK_URL=http://localhost:8006/auth/callback
|
|
NEXT_PUBLIC_AGPT_SERVER_URL=http://localhost:8006/api
|
|
NEXT_PUBLIC_AGPT_WS_SERVER_URL=ws://localhost:8001/ws
|
|
NEXT_PUBLIC_AGPT_MARKETPLACE_URL=http://localhost:8015/api/v1/market
|
|
NEXT_PUBLIC_LAUNCHDARKLY_ENABLED=false
|
|
NEXT_PUBLIC_LAUNCHDARKLY_CLIENT_ID=
|
|
NEXT_PUBLIC_APP_ENV=dev
|
|
|
|
## Supabase credentials
|
|
|
|
NEXT_PUBLIC_SUPABASE_URL=http://localhost:8000
|
|
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
|
|
|
|
## OAuth Callback URL
|
|
## This should be {domain}/auth/callback
|
|
## Only used if you're using Supabase and OAuth
|
|
AUTH_CALLBACK_URL=http://localhost:3000/auth/callback
|
|
GA_MEASUREMENT_ID=G-FH2XK2W4GN
|
|
|
|
# When running locally, set NEXT_PUBLIC_BEHAVE_AS=CLOUD to use the a locally hosted marketplace (as is typical in development, and the cloud deployment), otherwise set it to LOCAL to have the marketplace open in a new tab
|
|
NEXT_PUBLIC_BEHAVE_AS=LOCAL
|