You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @jonhassall, this is a great request. The API key docs are hard to find because not every API supports them. For the APIs which ARE supported, here's how you could take advantage of them:
useGoogle\Cloud\RecaptchaEnterprise\V1\Client\RecaptchaEnterpriseServiceClient;
useGoogle\Cloud\RecaptchaEnterprise\V1\ListKeysRequest;
useGoogle\ApiCore\InsecureCredentialsWrapper;
// Create a client.$recaptcha = newRecaptchaEnterpriseServiceClient([
// STEP 1: use insecure credentials wrapper to bypass application default creds'credentials' => newInsecureCredentialsWrapper(),
]);
// Prepare the request message.$formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]');
$request = (newListKeysRequest())->setParent($formattedParent);
// Call the API and handle any network failures./** @var PagedListResponse $response */$response = $recaptchaEnterpriseServiceClient->listKeys($request, [
// STEP 2: Pass in the API key with each RPC call as a "Call Option"'headers' => ['x-goog-api-key' => ['[API-KEY]']],
]);
Please improve your documentation on using an API key with your library.
The text was updated successfully, but these errors were encountered: