1. Go to this page and download the library: Download groupone/wap-client 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/ */
groupone / wap-client example snippets
use WapClient; // global facade defined by the package..
add_action('admin_menu', function () {
WapClient::register_chat_page([
'menu_slug' => 'my-plugin-wap-chat',
'parent_slug' => 'my-plugin-settings',
'page_title' => 'AI Assistant',
'product' => 'my-product-slug',
'server_url' => 'https://your-wap-backend.example.com',
'grnd' => [
'issuer_url' => 'https://api.my-brand.com/grnd/token',
'license_key' => get_option('my_product_license_key'),
],
'terms_url' => 'https://example.com/terms', // optional: footer "Terms of Use" link + consent gate
'privacy_url' => 'https://example.com/privacy', // optional: footer "Privacy Policy" link
]);
});
WapClient::register_chat_page([
'menu_slug' => 'my-plugin-onboarding',
'page_title' => 'Set up your site', // used as the document <title>
'hidden_admin_menu' => true,
'render_mode' => 'standalone',
'product' => 'my-product',
'server_url' => 'https://your-wap-backend.example.com',
'grnd' => ['issuer_url' => '…', 'license_key' => '…'],
]);