Skip to content

Commit dcfc28a

Browse files
committed
add usages
1 parent 1b43643 commit dcfc28a

File tree

3 files changed

+185
-2
lines changed

3 files changed

+185
-2
lines changed

.devcycle/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
org:
2+
id: org_kjcB9CgVuvVjdvxc
3+
name: parth-test-org-123
4+
display_name: parth test org 123
5+
project: audience-test-project
6+
matchPatterns:
7+
tsx:
8+
- useStringFlagValue\(\s*["']([^"']*)["']
9+
- useObjectFlagValue\(\s*["']([^"']*)["']
10+
- useBooleanFlagValue\(\s*["']([^"']*)["']
11+
- useNumberFlagValue\(\s*["']([^"']*)["']
12+
ts:
13+
- useStringFlagValue\(\s*["']([^"']*)["']
14+
- useObjectFlagValue\(\s*["']([^"']*)["']
15+
- useBooleanFlagValue\(\s*["']([^"']*)["']
16+
- useNumberFlagValue\(\s*["']([^"']*)["']
17+
js:
18+
- useStringFlagValue\(\s*["']([^"']*)["']
19+
- useObjectFlagValue\(\s*["']([^"']*)["']
20+
- useBooleanFlagValue\(\s*["']([^"']*)["']
21+
- useNumberFlagValue\(\s*["']([^"']*)["']
22+
jsx:
23+
- useStringFlagValue\(\s*["']([^"']*)["']
24+
- useObjectFlagValue\(\s*["']([^"']*)["']
25+
- useBooleanFlagValue\(\s*["']([^"']*)["']
26+
- useNumberFlagValue\(\s*["']([^"']*)["']

dvcVariableTypes.ts

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
import { DevCycleJSON } from '@devcycle/js-client-sdk'
2+
3+
declare module '@devcycle/types' {
4+
interface CustomVariableDefinitions extends DVCVariableTypes {}
5+
}
6+
7+
export type CustomData = {
8+
'is-premium-user'?: boolean
9+
'email'?: string
10+
'has_awards'?: boolean
11+
}
12+
export type DVCVariableTypes = {
13+
/**
14+
* key: banner-props
15+
* created by: Parth Suthar
16+
* created on: 2025-07-03
17+
*/
18+
'banner-props': DevCycleJSON
19+
/**
20+
* key: show-canada-day-banner
21+
* created by: Parth Suthar
22+
* created on: 2025-07-03
23+
*/
24+
'show-canada-day-banner': boolean
25+
/**
26+
* key: new-flow
27+
* created by: Parth Suthar
28+
* created on: 2025-06-20
29+
*/
30+
'new-flow': boolean
31+
/**
32+
* key: use-neon
33+
* created by: Parth Suthar
34+
* created on: 2025-06-20
35+
*/
36+
'use-neon': boolean
37+
/**
38+
* key: free-shipping
39+
* created by: Parth Suthar
40+
* created on: 2025-06-19
41+
*/
42+
'free-shipping': boolean
43+
/**
44+
* key: complete
45+
* created by: Parth Suthar
46+
* created on: 2025-06-05
47+
* @deprecated This variable is part of complete feature "complete" and should be cleaned up.
48+
49+
*/
50+
'complete': boolean
51+
/**
52+
* key: example-text
53+
* created by: Parth Suthar
54+
* created on: 2024-11-08
55+
*/
56+
'example-text': string
57+
/**
58+
* key: togglebot-speed
59+
* created by: Parth Suthar
60+
* created on: 2024-11-08
61+
*/
62+
'togglebot-speed': string
63+
/**
64+
* key: togglebot-wink
65+
* created by: Parth Suthar
66+
* created on: 2024-11-08
67+
*/
68+
'togglebot-wink': boolean
69+
/**
70+
* key: feature-to-test
71+
* created by: Parth Suthar
72+
* created on: 2023-09-25
73+
*/
74+
'feature-to-test': string
75+
}
76+
77+
/**
78+
* key: banner-props
79+
* created by: Parth Suthar
80+
* created on: 2025-07-03
81+
*/
82+
83+
export const BANNER_PROPS = 'banner-props' as const
84+
85+
/**
86+
* key: show-canada-day-banner
87+
* created by: Parth Suthar
88+
* created on: 2025-07-03
89+
*/
90+
91+
export const SHOW_CANADA_DAY_BANNER = 'show-canada-day-banner' as const
92+
93+
/**
94+
* key: new-flow
95+
* created by: Parth Suthar
96+
* created on: 2025-06-20
97+
*/
98+
99+
export const NEW_FLOW = 'new-flow' as const
100+
101+
/**
102+
* key: use-neon
103+
* created by: Parth Suthar
104+
* created on: 2025-06-20
105+
*/
106+
107+
export const USE_NEON = 'use-neon' as const
108+
109+
/**
110+
* key: free-shipping
111+
* created by: Parth Suthar
112+
* created on: 2025-06-19
113+
*/
114+
115+
export const FREE_SHIPPING = 'free-shipping' as const
116+
117+
/**
118+
* key: complete
119+
* created by: Parth Suthar
120+
* created on: 2025-06-05
121+
* @deprecated This variable is part of complete feature "complete" and should be cleaned up.
122+
123+
*/
124+
125+
export const COMPLETE = 'complete' as const
126+
127+
/**
128+
* key: example-text
129+
* created by: Parth Suthar
130+
* created on: 2024-11-08
131+
*/
132+
133+
export const EXAMPLE_TEXT = 'example-text' as const
134+
135+
/**
136+
* key: togglebot-speed
137+
* created by: Parth Suthar
138+
* created on: 2024-11-08
139+
*/
140+
141+
export const TOGGLEBOT_SPEED = 'togglebot-speed' as const
142+
143+
/**
144+
* key: togglebot-wink
145+
* created by: Parth Suthar
146+
* created on: 2024-11-08
147+
*/
148+
149+
export const TOGGLEBOT_WINK = 'togglebot-wink' as const
150+
151+
/**
152+
* key: feature-to-test
153+
* created by: Parth Suthar
154+
* created on: 2023-09-25
155+
*/
156+
157+
export const FEATURE_TO_TEST = 'feature-to-test' as const

src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Image from "next/image"
55
import Header from "../components/layout/Header"
66
import { useProducts } from "../hooks/useProducts"
77
import { Banner } from "@/components/ui"
8-
import { useObjectFlagValue } from "@openfeature/react-sdk"
8+
import { useVariableValue } from "@devcycle/nextjs-sdk"
99

1010
export default function Home() {
1111
const { data: products = [], isLoading, error, refetch } = useProducts()
@@ -16,7 +16,7 @@ export default function Home() {
1616
currency: "USD",
1717
}).format(price)
1818
}
19-
const bannerProperties = useObjectFlagValue("banner-props", {
19+
const bannerProperties = useVariableValue("banner-props", {
2020
title: "",
2121
message: "",
2222
discount: 0,

0 commit comments

Comments
 (0)