Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Question: Secure API key storage in WordPress Studio Preview sites

Open
#5,154 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
18/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Tech stack
php, wordpress
Domain
security

Research direction

The payload names no source files, tests or entry points, so there is no code to start from. The work is answering six questions about how Studio Preview sites handle wp-config.php constants, environment variables, secrets outside the document root, persistence across "Update Preview", and backups. Check the Studio docs or ask the maintainers for the platform behaviour before anything is written. Done means each question has a documented answer or a recommended approach that the issue author can act on.

Written by the indexing model from the issue text.

Description

Hello WordPress Studio team,

I am developing an AI shopping agent integration for a WooCommerce store using WordPress Studio.

I currently have an existing Preview site (Preview 2), and I need to securely store a private API authentication key called AAD_AGENT_KEY.

My WordPress plugin reads this key as a PHP constant.

Before proceeding, I would appreciate clarification on the following:

  1. Can custom PHP constants defined in the local wp-config.php be transferred to a Studio Preview site?

  2. Is there a supported way to configure private environment variables or server-side secrets in Preview sites?

  3. Can a secret be stored outside the public document root and accessed securely by PHP?

  4. Will these settings persist after using "Update Preview"?

  5. Are server-side secrets excluded from publicly accessible files, exports, and backups?

  6. If none of these options are supported, what is the recommended secure approach for authenticating an external AI agent with a WooCommerce store hosted on Studio Preview?

I would prefer to continue using my existing Preview site without creating a new one.

I have not generated or deployed the authentication key yet.

Thank you for your guidance!

Dominant language
TypeScript
Stars
543
Forks
104
Avg merge
1d 2h
Merged PRs (30d)
239

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/studio

All issues in Automattic/studio

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.