@sanity/personalization-plugin 2.3.0-growthbook.1 → 2.3.0-launch-darkly.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/index.d.mts +1 -191
- package/dist/index.d.ts +1 -191
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/launchDarkly/index.d.mts +12 -0
- package/dist/launchDarkly/index.d.ts +12 -0
- package/dist/launchDarkly/index.js +103 -0
- package/dist/launchDarkly/index.js.map +1 -0
- package/dist/launchDarkly/index.mjs +107 -0
- package/dist/launchDarkly/index.mjs.map +1 -0
- package/package.json +6 -6
- package/src/components/ExperimentField.tsx +4 -2
- package/src/launchDarkly/components/LaunchDarklyContext.tsx +36 -0
- package/src/{growthbook/Components → launchDarkly/components}/Secrets.tsx +5 -6
- package/src/{growthbook → launchDarkly}/index.ts +10 -10
- package/src/launchDarkly/types.ts +193 -0
- package/src/launchDarkly/utils.ts +54 -0
- package/src/types.ts +1 -179
- package/dist/growthbook/index.d.mts +0 -15
- package/dist/growthbook/index.d.ts +0 -15
- package/dist/growthbook/index.js +0 -118
- package/dist/growthbook/index.js.map +0 -1
- package/dist/growthbook/index.mjs +0 -122
- package/dist/growthbook/index.mjs.map +0 -1
- package/src/growthbook/Components/GrowthbookContext.tsx +0 -38
- package/src/growthbook/types.ts +0 -15
- package/src/growthbook/utils.ts +0 -94
package/README.md
CHANGED
|
@@ -25,8 +25,6 @@ Once configured you can query the values using the ids of the experiment and var
|
|
|
25
25
|
- [Release new version](#release-new-version)
|
|
26
26
|
- [License](#license-1)
|
|
27
27
|
|
|
28
|
-
For Specific information about the growthbookFieldLevel export see its [readme](/growthbook.md)
|
|
29
|
-
|
|
30
28
|
## Installation
|
|
31
29
|
|
|
32
30
|
```sh
|
package/dist/index.d.mts
CHANGED
|
@@ -42,9 +42,7 @@ export declare const fieldLevelExperiments: Plugin_2<FieldPluginConfig>
|
|
|
42
42
|
|
|
43
43
|
export declare type FieldPluginConfig = {
|
|
44
44
|
fields: (string | FieldDefinition)[]
|
|
45
|
-
experiments:
|
|
46
|
-
| ExperimentType[]
|
|
47
|
-
| ((client: SanityClient, secret?: string) => Promise<ExperimentType[]>)
|
|
45
|
+
experiments: ExperimentType[] | ((client: SanityClient) => Promise<ExperimentType[]>)
|
|
48
46
|
apiVersion?: string
|
|
49
47
|
experimentNameOverride?: string
|
|
50
48
|
variantNameOverride?: string
|
|
@@ -58,194 +56,6 @@ export declare type FieldPluginConfig = {
|
|
|
58
56
|
*/
|
|
59
57
|
export declare function flattenSchemaType(schemaType: SchemaType): ObjectFieldWithPath[]
|
|
60
58
|
|
|
61
|
-
export declare type GrowthbookExperiment = {
|
|
62
|
-
id: string
|
|
63
|
-
dateCreated: string
|
|
64
|
-
dateUpdated: string
|
|
65
|
-
name: string
|
|
66
|
-
project: string
|
|
67
|
-
hypothesis: string
|
|
68
|
-
description: string
|
|
69
|
-
tags: [string]
|
|
70
|
-
owner: string
|
|
71
|
-
archived: boolean
|
|
72
|
-
status: string
|
|
73
|
-
autoRefresh: boolean
|
|
74
|
-
hashAttribute: string
|
|
75
|
-
fallbackAttribute: string
|
|
76
|
-
hashVersion: number
|
|
77
|
-
disableStickyBucketing: boolean
|
|
78
|
-
bucketVersion: number
|
|
79
|
-
minBucketVersion: number
|
|
80
|
-
variations: [
|
|
81
|
-
{
|
|
82
|
-
variationId: string
|
|
83
|
-
key: string
|
|
84
|
-
name: string
|
|
85
|
-
description: string
|
|
86
|
-
screenshots: [string]
|
|
87
|
-
},
|
|
88
|
-
]
|
|
89
|
-
phases: [
|
|
90
|
-
{
|
|
91
|
-
name: string
|
|
92
|
-
dateStarted: string
|
|
93
|
-
dateEnded: string
|
|
94
|
-
reasonForStopping: string
|
|
95
|
-
seed: string
|
|
96
|
-
coverage: 0
|
|
97
|
-
trafficSplit: [
|
|
98
|
-
{
|
|
99
|
-
variationId: string
|
|
100
|
-
weight: 0
|
|
101
|
-
},
|
|
102
|
-
]
|
|
103
|
-
namespace: {
|
|
104
|
-
namespaceId: string
|
|
105
|
-
range: []
|
|
106
|
-
}
|
|
107
|
-
targetingCondition: string
|
|
108
|
-
savedGroupTargeting: [
|
|
109
|
-
{
|
|
110
|
-
matchType: string
|
|
111
|
-
savedGroups: [string]
|
|
112
|
-
},
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
]
|
|
116
|
-
settings: {
|
|
117
|
-
datasourceId: string
|
|
118
|
-
assignmentQueryId: string
|
|
119
|
-
experimentId: string
|
|
120
|
-
segmentId: string
|
|
121
|
-
queryFilter: string
|
|
122
|
-
inProgressConversions: string
|
|
123
|
-
attributionModel: string
|
|
124
|
-
statsEngine: string
|
|
125
|
-
regressionAdjustmentEnabled: boolean
|
|
126
|
-
goals: [
|
|
127
|
-
{
|
|
128
|
-
metricId: string
|
|
129
|
-
overrides: {
|
|
130
|
-
delayHours: 0
|
|
131
|
-
windowHours: 0
|
|
132
|
-
window: string
|
|
133
|
-
winRiskThreshold: 0
|
|
134
|
-
loseRiskThreshold: 0
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
]
|
|
138
|
-
secondaryMetrics: [
|
|
139
|
-
{
|
|
140
|
-
metricId: string
|
|
141
|
-
overrides: {
|
|
142
|
-
delayHours: 0
|
|
143
|
-
windowHours: 0
|
|
144
|
-
window: string
|
|
145
|
-
winRiskThreshold: 0
|
|
146
|
-
loseRiskThreshold: 0
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
]
|
|
150
|
-
guardrails: [
|
|
151
|
-
{
|
|
152
|
-
metricId: string
|
|
153
|
-
overrides: {
|
|
154
|
-
delayHours: 0
|
|
155
|
-
windowHours: 0
|
|
156
|
-
window: string
|
|
157
|
-
winRiskThreshold: 0
|
|
158
|
-
loseRiskThreshold: 0
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
]
|
|
162
|
-
activationMetric: {
|
|
163
|
-
metricId: string
|
|
164
|
-
overrides: {
|
|
165
|
-
delayHours: 0
|
|
166
|
-
windowHours: 0
|
|
167
|
-
window: string
|
|
168
|
-
winRiskThreshold: 0
|
|
169
|
-
loseRiskThreshold: 0
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
resultSummary: {
|
|
174
|
-
status: string
|
|
175
|
-
winner: string
|
|
176
|
-
conclusions: string
|
|
177
|
-
releasedVariationId: string
|
|
178
|
-
excludeFromPayload: boolean
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export declare type GrowthbookFeature = {
|
|
183
|
-
id: string
|
|
184
|
-
dateCreated: string
|
|
185
|
-
dateUpdated: string
|
|
186
|
-
archived: boolean
|
|
187
|
-
description: string
|
|
188
|
-
owner: string
|
|
189
|
-
project: string
|
|
190
|
-
valueType: string
|
|
191
|
-
defaultValue: string
|
|
192
|
-
tags: string[]
|
|
193
|
-
environments: {
|
|
194
|
-
[key: string]: {
|
|
195
|
-
enabled: boolean
|
|
196
|
-
defaultValue: string
|
|
197
|
-
rules: {
|
|
198
|
-
description: string
|
|
199
|
-
condition: string
|
|
200
|
-
savedGroupTargeting: {
|
|
201
|
-
matchType: string
|
|
202
|
-
savedGroups: string[]
|
|
203
|
-
}[]
|
|
204
|
-
id: string
|
|
205
|
-
enabled: boolean
|
|
206
|
-
type: string
|
|
207
|
-
value: string
|
|
208
|
-
variations: {
|
|
209
|
-
value: string
|
|
210
|
-
variationId: string
|
|
211
|
-
}[]
|
|
212
|
-
}[]
|
|
213
|
-
definition: string
|
|
214
|
-
draft: {
|
|
215
|
-
enabled: boolean
|
|
216
|
-
defaultValue: string
|
|
217
|
-
rules: {
|
|
218
|
-
description: string
|
|
219
|
-
condition: string
|
|
220
|
-
savedGroupTargeting: {
|
|
221
|
-
matchType: string
|
|
222
|
-
savedGroups: string[]
|
|
223
|
-
}[]
|
|
224
|
-
id: string
|
|
225
|
-
enabled: boolean
|
|
226
|
-
type: string
|
|
227
|
-
value: string
|
|
228
|
-
variations: {
|
|
229
|
-
value: string
|
|
230
|
-
variationId: string
|
|
231
|
-
}[]
|
|
232
|
-
}[]
|
|
233
|
-
definition: string
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
prerequisites: {
|
|
238
|
-
parentId: string
|
|
239
|
-
parentCondition: string
|
|
240
|
-
}[]
|
|
241
|
-
revision: {
|
|
242
|
-
version: number
|
|
243
|
-
comment: string
|
|
244
|
-
date: string
|
|
245
|
-
publishedBy: string
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
59
|
export declare type ObjectFieldWithPath = ObjectField<SchemaType> & {
|
|
250
60
|
path: Path
|
|
251
61
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -42,9 +42,7 @@ export declare const fieldLevelExperiments: Plugin_2<FieldPluginConfig>
|
|
|
42
42
|
|
|
43
43
|
export declare type FieldPluginConfig = {
|
|
44
44
|
fields: (string | FieldDefinition)[]
|
|
45
|
-
experiments:
|
|
46
|
-
| ExperimentType[]
|
|
47
|
-
| ((client: SanityClient, secret?: string) => Promise<ExperimentType[]>)
|
|
45
|
+
experiments: ExperimentType[] | ((client: SanityClient) => Promise<ExperimentType[]>)
|
|
48
46
|
apiVersion?: string
|
|
49
47
|
experimentNameOverride?: string
|
|
50
48
|
variantNameOverride?: string
|
|
@@ -58,194 +56,6 @@ export declare type FieldPluginConfig = {
|
|
|
58
56
|
*/
|
|
59
57
|
export declare function flattenSchemaType(schemaType: SchemaType): ObjectFieldWithPath[]
|
|
60
58
|
|
|
61
|
-
export declare type GrowthbookExperiment = {
|
|
62
|
-
id: string
|
|
63
|
-
dateCreated: string
|
|
64
|
-
dateUpdated: string
|
|
65
|
-
name: string
|
|
66
|
-
project: string
|
|
67
|
-
hypothesis: string
|
|
68
|
-
description: string
|
|
69
|
-
tags: [string]
|
|
70
|
-
owner: string
|
|
71
|
-
archived: boolean
|
|
72
|
-
status: string
|
|
73
|
-
autoRefresh: boolean
|
|
74
|
-
hashAttribute: string
|
|
75
|
-
fallbackAttribute: string
|
|
76
|
-
hashVersion: number
|
|
77
|
-
disableStickyBucketing: boolean
|
|
78
|
-
bucketVersion: number
|
|
79
|
-
minBucketVersion: number
|
|
80
|
-
variations: [
|
|
81
|
-
{
|
|
82
|
-
variationId: string
|
|
83
|
-
key: string
|
|
84
|
-
name: string
|
|
85
|
-
description: string
|
|
86
|
-
screenshots: [string]
|
|
87
|
-
},
|
|
88
|
-
]
|
|
89
|
-
phases: [
|
|
90
|
-
{
|
|
91
|
-
name: string
|
|
92
|
-
dateStarted: string
|
|
93
|
-
dateEnded: string
|
|
94
|
-
reasonForStopping: string
|
|
95
|
-
seed: string
|
|
96
|
-
coverage: 0
|
|
97
|
-
trafficSplit: [
|
|
98
|
-
{
|
|
99
|
-
variationId: string
|
|
100
|
-
weight: 0
|
|
101
|
-
},
|
|
102
|
-
]
|
|
103
|
-
namespace: {
|
|
104
|
-
namespaceId: string
|
|
105
|
-
range: []
|
|
106
|
-
}
|
|
107
|
-
targetingCondition: string
|
|
108
|
-
savedGroupTargeting: [
|
|
109
|
-
{
|
|
110
|
-
matchType: string
|
|
111
|
-
savedGroups: [string]
|
|
112
|
-
},
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
]
|
|
116
|
-
settings: {
|
|
117
|
-
datasourceId: string
|
|
118
|
-
assignmentQueryId: string
|
|
119
|
-
experimentId: string
|
|
120
|
-
segmentId: string
|
|
121
|
-
queryFilter: string
|
|
122
|
-
inProgressConversions: string
|
|
123
|
-
attributionModel: string
|
|
124
|
-
statsEngine: string
|
|
125
|
-
regressionAdjustmentEnabled: boolean
|
|
126
|
-
goals: [
|
|
127
|
-
{
|
|
128
|
-
metricId: string
|
|
129
|
-
overrides: {
|
|
130
|
-
delayHours: 0
|
|
131
|
-
windowHours: 0
|
|
132
|
-
window: string
|
|
133
|
-
winRiskThreshold: 0
|
|
134
|
-
loseRiskThreshold: 0
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
]
|
|
138
|
-
secondaryMetrics: [
|
|
139
|
-
{
|
|
140
|
-
metricId: string
|
|
141
|
-
overrides: {
|
|
142
|
-
delayHours: 0
|
|
143
|
-
windowHours: 0
|
|
144
|
-
window: string
|
|
145
|
-
winRiskThreshold: 0
|
|
146
|
-
loseRiskThreshold: 0
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
]
|
|
150
|
-
guardrails: [
|
|
151
|
-
{
|
|
152
|
-
metricId: string
|
|
153
|
-
overrides: {
|
|
154
|
-
delayHours: 0
|
|
155
|
-
windowHours: 0
|
|
156
|
-
window: string
|
|
157
|
-
winRiskThreshold: 0
|
|
158
|
-
loseRiskThreshold: 0
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
]
|
|
162
|
-
activationMetric: {
|
|
163
|
-
metricId: string
|
|
164
|
-
overrides: {
|
|
165
|
-
delayHours: 0
|
|
166
|
-
windowHours: 0
|
|
167
|
-
window: string
|
|
168
|
-
winRiskThreshold: 0
|
|
169
|
-
loseRiskThreshold: 0
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
resultSummary: {
|
|
174
|
-
status: string
|
|
175
|
-
winner: string
|
|
176
|
-
conclusions: string
|
|
177
|
-
releasedVariationId: string
|
|
178
|
-
excludeFromPayload: boolean
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export declare type GrowthbookFeature = {
|
|
183
|
-
id: string
|
|
184
|
-
dateCreated: string
|
|
185
|
-
dateUpdated: string
|
|
186
|
-
archived: boolean
|
|
187
|
-
description: string
|
|
188
|
-
owner: string
|
|
189
|
-
project: string
|
|
190
|
-
valueType: string
|
|
191
|
-
defaultValue: string
|
|
192
|
-
tags: string[]
|
|
193
|
-
environments: {
|
|
194
|
-
[key: string]: {
|
|
195
|
-
enabled: boolean
|
|
196
|
-
defaultValue: string
|
|
197
|
-
rules: {
|
|
198
|
-
description: string
|
|
199
|
-
condition: string
|
|
200
|
-
savedGroupTargeting: {
|
|
201
|
-
matchType: string
|
|
202
|
-
savedGroups: string[]
|
|
203
|
-
}[]
|
|
204
|
-
id: string
|
|
205
|
-
enabled: boolean
|
|
206
|
-
type: string
|
|
207
|
-
value: string
|
|
208
|
-
variations: {
|
|
209
|
-
value: string
|
|
210
|
-
variationId: string
|
|
211
|
-
}[]
|
|
212
|
-
}[]
|
|
213
|
-
definition: string
|
|
214
|
-
draft: {
|
|
215
|
-
enabled: boolean
|
|
216
|
-
defaultValue: string
|
|
217
|
-
rules: {
|
|
218
|
-
description: string
|
|
219
|
-
condition: string
|
|
220
|
-
savedGroupTargeting: {
|
|
221
|
-
matchType: string
|
|
222
|
-
savedGroups: string[]
|
|
223
|
-
}[]
|
|
224
|
-
id: string
|
|
225
|
-
enabled: boolean
|
|
226
|
-
type: string
|
|
227
|
-
value: string
|
|
228
|
-
variations: {
|
|
229
|
-
value: string
|
|
230
|
-
variationId: string
|
|
231
|
-
}[]
|
|
232
|
-
}[]
|
|
233
|
-
definition: string
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
prerequisites: {
|
|
238
|
-
parentId: string
|
|
239
|
-
parentCondition: string
|
|
240
|
-
}[]
|
|
241
|
-
revision: {
|
|
242
|
-
version: number
|
|
243
|
-
comment: string
|
|
244
|
-
date: string
|
|
245
|
-
publishedBy: string
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
59
|
export declare type ObjectFieldWithPath = ObjectField<SchemaType> & {
|
|
250
60
|
path: Path
|
|
251
61
|
}
|