Ir al contenido principal

StartPlaygroundOptions

Index

Properties

optionalblueprint

blueprint?: BlueprintV1

optionalcorsProxy

corsProxy?: string

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.

optionaldisableProgressBar

disableProgressBar?: boolean

optionalexperimentalBlueprintsV2Runner

experimentalBlueprintsV2Runner?: boolean

Prefer experimental Blueprints v2 PHP runner instead of TypeScript steps

optionalgitAdditionalHeadersCallback

gitAdditionalHeadersCallback?: (url: string) => Record<string, string>

Additional headers to pass to git operations. A function that returns headers based on the URL being accessed.


Type declaration

    • (url: string): Record<string, string>
    • Parameters

      • url: string

      Returns Record<string, string>

iframe

iframe: HTMLIFrameElement

optionalmounts

mounts?: MountDescriptor[]

optionalonBlueprintStepCompleted

onBlueprintStepCompleted?: OnStepCompleted

optionalonBlueprintValidated

onBlueprintValidated?: (blueprint: BlueprintV1Declaration) => void

Type declaration

optionalonClientConnected

onClientConnected?: (playground: PlaygroundClient) => void

Called when the playground client is connected, but before the blueprint steps are run.

@returns

Type declaration

optionalpathAliases

pathAliases?: PathAlias[]

Path aliases that map URL prefixes to filesystem paths outside the document root. Similar to Nginx's alias directive.

@example
pathAliases: [
{ urlPrefix: '/phpmyadmin', fsPath: '/tools/phpmyadmin' }
]

optionalprogressTracker

progressTracker?: ProgressTracker

remoteUrl

remoteUrl: string

optionalscope

scope?: string

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.

optionalshouldBootWordPress

shouldBootWordPress?: boolean

Whether to run WordPress boot setup.

This is separate from shouldInstallWordPress because saved sites can boot from existing WordPress files without downloading or installing a fresh copy. Set this to false for PHP-only Playgrounds.

If shouldInstallWordPress is false and this option is true, WordPress files must already be present, for example via mounts or a saved site.

optionalshouldInstallWordPress

shouldInstallWordPress?: boolean

Whether to download/install WordPress files.

Set this to false when WordPress files are already available, for example from mounts or a saved site.

This option cannot be set to true when shouldBootWordPress is false, because installing WordPress requires running the WordPress boot setup.

optionalsqliteDriverVersion

sqliteDriverVersion?: string

The version of the SQLite driver to use. Defaults to the latest development version.

optionalwordpressInstallMode

wordpressInstallMode?: WordPressInstallMode

How to handle WordPress installation. Defaults to 'install-from-existing-files-if-needed'.