1. Go to this page and download the library: Download gitsbt/waylume-sdk 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/ */
gitsbt / waylume-sdk example snippets
use Waylume\Sdk\License\LicenseProofSigner;
= json_decode(file_get_contents('php://input'), true) ?? [];
$requestedHostname = LicenseProofSigner::normalizeHostname((string) ($input['hostname'] ?? ''));
// Read this fixed value from your application's trusted configuration.
// Never derive it from the request body or the HTTP Host header.
$allowedHostname = 'app.example.com';
if ($requestedHostname === '' || $requestedHostname !== $allowedHostname) {
http_response_code(403);
echo json_encode(['error' => 'Hostname is not allowed.']);
exit;
}
$signer = LicenseProofSigner::fromPrivateKey((string) getenv('WAYLUME_PRIVATE_KEY'));
echo $signer->sign($allowedHostname)->toJson();
use Waylume\Sdk\Flow\FlowRegistry;
$registry = new FlowRegistry();
$registry->register([
'id' => 'upgrade-to-pro',
'label' => 'Upgrade to Pro',
'steps' => [
[
'id' => 'upgrade-btn',
'summary' => 'Start the upgrade',
'instruction' => 'Click Upgrade to Pro.',
'target' => 'upgrade-btn',
'actionType' => 'click',
'waitFor' => 'navigation',
'expectedUrlPattern' => '/',
],
],
]);