Skip to content

Commit 34d6be0

Browse files
authored
Merge pull request #47 from pattern-tech/feat/feature-flags
feat: add feature flags support
2 parents c5f411e + a9e17a9 commit 34d6be0

5 files changed

Lines changed: 117 additions & 2 deletions

File tree

.env.example

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
# WalletConnect project ID for Web3 wallet connections (used in SIWE)
12
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
3+
4+
# Secret key for NextAuth.js session encryption and JWT signing
25
NEXTAUTH_SECRET=
3-
PATTERN_CORE_ENDPOINT=
6+
# Whether to trust the host for authentication
7+
# https://authjs.dev/getting-started/deployment#auth_trust_host
48
AUTH_TRUST_HOST=
9+
10+
# Endpoint URL for the Pattern Core API service
11+
PATTERN_CORE_ENDPOINT=
12+
13+
# API token for Axiom logging service
514
NEXT_PUBLIC_AXIOM_TOKEN=
15+
# Dataset name for Axiom logging service
616
NEXT_PUBLIC_AXIOM_DATASET=
17+
18+
# Connection string of Vercel Edge Store
19+
EDGE_CONFIG=

lib/flags.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { edgeConfigAdapter } from '@flags-sdk/edge-config';
2+
import { flag } from 'flags/next';
3+
4+
/**
5+
* @example
6+
* export const someFlag = flag({
7+
* adapter: edgeConfigAdapter(),
8+
* key: 'some-flag',
9+
* });
10+
*/

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@codemirror/state": "^6.5.0",
2222
"@codemirror/theme-one-dark": "^6.1.2",
2323
"@codemirror/view": "^6.35.3",
24+
"@flags-sdk/edge-config": "^0.1.0",
2425
"@radix-ui/react-alert-dialog": "^1.1.2",
2526
"@radix-ui/react-dialog": "^1.1.2",
2627
"@radix-ui/react-dropdown-menu": "^2.1.2",
@@ -37,6 +38,7 @@
3738
"@tanstack/react-query": "^5.66.9",
3839
"@vercel/analytics": "^1.3.1",
3940
"@vercel/blob": "^0.24.1",
41+
"@vercel/edge-config": "^1.4.0",
4042
"@vercel/postgres": "^0.10.0",
4143
"@wagmi/core": "^2.16.4",
4244
"ai": "4.1.44",
@@ -50,6 +52,7 @@
5052
"dotenv": "^16.4.5",
5153
"drizzle-orm": "^0.34.0",
5254
"fast-deep-equal": "^3.1.3",
55+
"flags": "^3.2.0",
5356
"framer-motion": "^11.3.19",
5457
"geist": "^1.3.1",
5558
"lucide-react": "^0.446.0",

pnpm-lock.yaml

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)