diff --git a/website/docs/api-clients/installation.mdx b/website/docs/api-clients/installation.mdx index f1e3c68604..26c562fc08 100644 --- a/website/docs/api-clients/installation.mdx +++ b/website/docs/api-clients/installation.mdx @@ -9,7 +9,8 @@ import TabItem from '@theme/TabItem'; groupId="language" defaultValue="js" values={[ - { label: 'JavaScript', value: 'js', } + { label: 'JavaScript', value: 'js', }, + { label: 'PHP', value: 'php', } ] }> @@ -111,5 +112,41 @@ const res = await personalizationClient.getUserTokenProfile({ console.log('[Results]', res); ``` + + + + +## Installation + +First, install Algolia PHP API Client via the composer package manager: +```bash +composer require algolia/algoliasearch-client-php +``` +## Using the client + +Then, create objects on your index: +```php +$client = Algolia\AlgoliaSearch\Api\SearchClient::create( + '', + '' +); + +$client->saveObject('', ['objectID' => 1, 'name' => 'Foo']); +``` + +Finally, you may begin searching an object using the `search` method: +```php +$objects = $client->search('', ['query' => 'Foo']); +``` + +Another example with the personalization client: +```php +$client = Algolia\AlgoliaSearch\Api\PersonalizationClient::create( + '', + '' +); + +$res = $client->getUserTokenProfile(''); +```