StartPlaygroundOptions
Index
Properties
- blueprint
- corsProxy
- detailedProgressCaptions
- disableProgressBar
- extensions
- gitAdditionalHeadersCallback
- iframe
- mounts
- onBlueprintStepCompleted
- onBlueprintValidated
- onClientConnected
- pathAliases
- progressTracker
- remoteUrl
- scope
- sharedWorkerClientVersion
- sharedWorkerVersion
- shouldInstallWordPress
- sqliteDriverVersion
- wordpressInstallMode
- workerMode
Properties
optionalblueprint
optionalcorsProxy
optionaldetailedProgressCaptions
Report fine-grained boot captions (runtime download percentage, stall notices, individual WordPress boot steps) through the progress tracker instead of the single "Preparing WordPress" caption. Off by default so existing embedders keep their loading text.
optionaldisableProgressBar
optionalextensions
PHP extensions to install before the runtime starts.
optionalgitAdditionalHeadersCallback
Additional headers to pass to git operations. A function that returns headers based on the URL being accessed.
Type declaration
Parameters
url: string
Returns Record<string, string>
iframe
optionalmounts
optionalonBlueprintStepCompleted
optionalonBlueprintValidated
Type declaration
Parameters
blueprint: BlueprintV1Declaration
Returns void
optionalonClientConnected
Called when the playground client is connected, but before the blueprint steps are run.
Type declaration
Parameters
playground: PlaygroundClient
Returns void
optionalpathAliases
Path aliases that map URL prefixes to filesystem paths outside
the document root. Similar to Nginx's alias directive.
optionalprogressTracker
remoteUrl
optionalscope
The string prefix used in the site URL served by the currently
running remote.html. E.g. for a prefix like /scope:playground/,
the scope would be playground. See the @php-wasm/scopes package
for more details.
Required in shared mode. Use the same scope for tabs sharing a site and different
scopes for independent sites.
optionalsharedWorkerClientVersion
Build version of the application opening this connection. Defaults to the remote
runtime's build version. A mismatch with sharedWorkerVersion requires the tab
to reload before connecting. Ignored in dedicated mode.
optionalsharedWorkerVersion
Current deployment version used to identify the shared worker and retire a previous build. Defaults to the remote runtime's build version. Ignored in dedicated mode.
optionalshouldInstallWordPress
optionalsqliteDriverVersion
The version of the SQLite driver to use. Defaults to the latest development version.
optionalwordpressInstallMode
How to handle WordPress installation.
Defaults to download-and-install.
optionalworkerMode
Runtime mode. Defaults to dedicated, with one worker per connection.
shared connects tabs on the same origin and storage partition to one runtime
for the given scope and build. Requires SharedWorker support and an explicit scope.
Only the initializing connection runs the startup Blueprint; later connections
reuse the initialized site. After initialization, closing one tab does not interrupt
other connected tabs.
Proxy URL to use for cross-origin requests.
For example, if corsProxy is set to "https://cors.wordpress.net/proxy.php", then the CORS requests to https://github.com/WordPress/wordpress-playground.git would actually be made to https://cors.wordpress.net/proxy.php?https://github.com/WordPress/wordpress-playground.git.
The Blueprints library will arbitrarily choose which requests to proxy. If you need to proxy every single request, do not use this option. Instead, you should preprocess your Blueprint to replace all cross-origin URLs with the proxy URL.