Stay organized with collections
Save and categorize content based on your preferences.
interface HasApiKey<O : Api.ApiOptions?>
Known indirect subclasses
Anything that has an ApiKey
.
This is used to allow GoogleApi
-based clients to be exposed via interface instead of subclass. Those interfaces can be declared as extending this, and GoogleApi
's will automatically fulfill the interface.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-17 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-17 UTC."],[[["\u003cp\u003e\u003ccode\u003eHasApiKey\u003c/code\u003e is an interface that represents any object possessing an API key.\u003c/p\u003e\n"],["\u003cp\u003eIt enables GoogleApi-based clients to be exposed through interfaces rather than subclasses for greater flexibility.\u003c/p\u003e\n"],["\u003cp\u003eInterfaces extending \u003ccode\u003eHasApiKey\u003c/code\u003e are automatically implemented by \u003ccode\u003eGoogleApi\u003c/code\u003e instances.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGoogleApi\u003c/code\u003e and \u003ccode\u003eModuleInstallClient\u003c/code\u003e are known subclasses of \u003ccode\u003eHasApiKey\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["HasApiKey \nKotlin \\|[Java](/android/reference/com/google/android/gms/common/api/HasApiKey \"View this page in Java\") \n\n\n```\ninterface HasApiKey\u003cO : Api.ApiOptions?\u003e\n```\n\n\u003cbr /\u003e\n\nKnown direct subclasses \n[AuthorizationClient](/android/reference/kotlin/com/google/android/gms/auth/api/identity/AuthorizationClient), [CredentialSavingClient](/android/reference/kotlin/com/google/android/gms/auth/api/identity/CredentialSavingClient), [GoogleApi](/android/reference/kotlin/com/google/android/gms/common/api/GoogleApi), [ModuleInstallClient](/android/reference/kotlin/com/google/android/gms/common/moduleinstall/ModuleInstallClient), [SignInClient](/android/reference/kotlin/com/google/android/gms/auth/api/identity/SignInClient) \n\n|---------------------------------------------------------------------------------------------------------------------|-----------------------------------------|\n| [AuthorizationClient](/android/reference/kotlin/com/google/android/gms/auth/api/identity/AuthorizationClient) | A client for the authorization API. |\n| [CredentialSavingClient](/android/reference/kotlin/com/google/android/gms/auth/api/identity/CredentialSavingClient) | A client for the Credential Saving API. |\n| [GoogleApi](/android/reference/kotlin/com/google/android/gms/common/api/GoogleApi) | Base class for Google API entry points. |\n| [ModuleInstallClient](/android/reference/kotlin/com/google/android/gms/common/moduleinstall/ModuleInstallClient) | Interface for module install APIs. |\n| [SignInClient](/android/reference/kotlin/com/google/android/gms/auth/api/identity/SignInClient) | A client for the sign-in API. |\n\nKnown indirect subclasses \n[GoogleSignInClient](/android/reference/kotlin/com/google/android/gms/auth/api/signin/GoogleSignInClient) \n\n|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GoogleSignInClient](/android/reference/kotlin/com/google/android/gms/auth/api/signin/GoogleSignInClient) | **This class is deprecated.** Use [Credential Manager](https://developer.android.com/training/sign-in/credential-manager) for authentication or [Google Identity Services](https://developers.google.com/identity/sign-in/android/authorize-access) for authorization. \u003cbr /\u003e |\n\n*** ** * ** ***\n\nAnything that has an `ApiKey`.\n\nThis is used to allow [GoogleApi](/android/reference/kotlin/com/google/android/gms/common/api/GoogleApi)-based clients to be exposed via interface instead of subclass. Those interfaces can be declared as extending this, and [GoogleApi](/android/reference/kotlin/com/google/android/gms/common/api/GoogleApi)'s will automatically fulfill the interface."]]