Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the injected YEXT_STUDIO_API_KEY to the ManagementApiService. #372

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

tmeyer2115
Copy link
Contributor

This PR adds logic to the creation of the Studio Vite Plugin. If there is an env var called YEXT_STUDIO_API_KEY, we use that to create an instance of the ManagementApiService. This environment variable should be available in all Studio CBD containers. The value of the variable is an API Key that will give the Studio instance access to the Management API. This is the API that powers Stream Scope Selection.

TEST=manual

Tested locally. I did not have the env var set and saw that Stream Scope Selection was disabled. Then I set the env var and saw that the Scope Selection dropdowns were populated correctly.

This PR adds logic to the creation of the Studio Vite Plugin. If there is
an env var called `YEXT_STUDIO_API_KEY`, we use that to create an instance
of the `ManagementApiService`. This environment variable should be available
in all Studio CBD containers. The value of the variable is an API Key that will
give the Studio instance access to the Management API. This is the API that
powers Stream Scope Selection.

TEST=manual

Tested locally. I did not have the env var set and saw that Stream Scope
Selection was disabled. Then I set the env var and saw that the Scope
Selection dropdowns were populated correctly.
@tmeyer2115 tmeyer2115 added the wip label Sep 14, 2023
Comment on lines +70 to +73
const managementAPIService =
studioConfig.isPagesJSRepo && process.env.YEXT_STUDIO_API_KEY
? new ManagementApiService(process.env.YEXT_STUDIO_API_KEY)
: undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a little simpler to do this in createConfigureStudioServer?

@tmeyer2115 tmeyer2115 merged commit 982511c into feature/add-page-improvements Sep 21, 2023
15 checks passed
@oshi97 oshi97 deleted the dev/api-key-injection branch September 22, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants