Skip to main content
In some cases, you might want to access the Algolia client directly to perform advanced operations, like managing API keys and managing indices. By default, the Algolia\AlgoliaSearch\SearchClient is public in the Symfony container. To be able to use it, you only have to inject or retrieve it with the search.client key. For example:
PHP
class TestController extends AbstractController
{
    /**
     * @param SearchClient $client
     * @return JsonResponse
     */
    public function listApiKeysAction(SearchClient $client): JsonResponse
    {
        return new JsonResponse($client->listApiKeys());
    }
}
I