File tree Expand file tree Collapse file tree 3 files changed +67
-36
lines changed
integrations/launchdarkly/src Expand file tree Collapse file tree 3 files changed +67
-36
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @gitbook/integration-launchdarkly ' : minor
3
+ ---
4
+
5
+ Fix LaunchDarkly integration API call to get flags and config screen missing project key input
Original file line number Diff line number Diff line change @@ -86,39 +86,65 @@ export const configBlock = createComponent<
86
86
return (
87
87
< configuration >
88
88
{ isAdaptiveContentEnabled ? (
89
- < block >
90
- < input
91
- label = "Secret key"
92
- hint = {
93
- < text >
94
- The secret key from your LaunchDarkly{ ' ' }
95
- < link
96
- target = { {
97
- url : 'https://app.LaunchDarkly.co/envs/current/settings/app-environments' ,
89
+ < box >
90
+ < vstack >
91
+ < input
92
+ label = "Project key"
93
+ hint = {
94
+ < text >
95
+ The project key of your LaunchDarkly{ ' ' }
96
+ < link
97
+ target = { {
98
+ url : 'https://app.launchdarkly.com/settings/projects' ,
99
+ } }
100
+ >
101
+ environment.
102
+ </ link >
103
+ </ text >
104
+ }
105
+ element = {
106
+ < textinput state = "project_key" placeholder = "Project key" />
107
+ }
108
+ />
109
+ < input
110
+ label = "Service access token"
111
+ hint = {
112
+ < text >
113
+ A service token with reader role created in your
114
+ LaunchDarkly{ ' ' }
115
+ < link
116
+ target = { {
117
+ url : 'https://app.launchdarkly.com/settings/authorization' ,
118
+ } }
119
+ >
120
+ project.
121
+ </ link >
122
+ </ text >
123
+ }
124
+ element = {
125
+ < textinput
126
+ state = "service_token"
127
+ placeholder = "Service access token"
128
+ />
129
+ }
130
+ />
131
+ < input
132
+ label = ""
133
+ hint = ""
134
+ element = {
135
+ < button
136
+ style = "primary"
137
+ disabled = { false }
138
+ label = "Save"
139
+ tooltip = "Save configuration"
140
+ onPress = { {
141
+ action : 'save.config' ,
98
142
} }
99
- >
100
- environment settings.
101
- </ link >
102
- </ text >
103
- }
104
- element = { < textinput state = "secret_key" placeholder = "Secret key" /> }
105
- />
106
- < input
107
- label = ""
108
- hint = ""
109
- element = {
110
- < button
111
- style = "primary"
112
- disabled = { false }
113
- label = "Save"
114
- tooltip = "Save configuration"
115
- onPress = { {
116
- action : 'save.config' ,
117
- } }
118
- />
119
- }
120
- />
121
- </ block >
143
+ />
144
+ }
145
+ />
146
+ </ vstack >
147
+ </ box >
122
148
) : (
123
149
< input
124
150
label = "Enable Adaptive Content"
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ async function handleSyncAdaptiveSchema(
95
95
getExistingAdaptiveSchema ( api , organizationId , siteId ) ,
96
96
getFeatureFlags ( {
97
97
projectKey,
98
- token : serviceToken ,
98
+ serviceToken,
99
99
} ) ,
100
100
] ) ;
101
101
@@ -197,11 +197,11 @@ async function getExistingAdaptiveSchema(
197
197
}
198
198
}
199
199
200
- async function getFeatureFlags ( args : { projectKey : string ; token : string } ) {
201
- const { projectKey, token } = args ;
200
+ async function getFeatureFlags ( args : { projectKey : string ; serviceToken : string } ) {
201
+ const { projectKey, serviceToken } = args ;
202
202
const res = await fetch ( `https://app.launchdarkly.com/api/v2/flags/${ projectKey } ` , {
203
203
headers : {
204
- Authorization : `Bearer ${ token } ` ,
204
+ Authorization : serviceToken ,
205
205
} ,
206
206
} ) ;
207
207
You can’t perform that action at this time.
0 commit comments