PHP code example of cloakwp / decoupled

1. Go to this page and download the library: Download cloakwp/decoupled library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cloakwp / decoupled example snippets


# Required
define('MY_FRONTEND_URL', 'https://example.com'); // decoupled frontend URL
define('CLOAKWP_AUTH_SECRET', '1234_CUSTOMIZE_ME'); // secure secret key

# Optional
# define('CLOAKWP_API_BASE_PATH', 'custom-route'); // defaults to "cloakwp"; must match your front-end's dynamic API route folder name where you import the CloakWP.js `ApiRouter`
# define('CLOAKWP_PREVIEW_BLOCK_PATHNAME', '/custom-route'); // defaults to "/preview-block"; must match your front-end's page route where you import the CloakWP.js `BlockPreviewPage`