> [!NOTE]
> **Note:** Pub/Sub Lite is deprecated. Effective January 31, 2027, Pub/Sub Lite will be turned down.   
>
> - Current customers: Pub/Sub Lite remains functional until January 31, 2027.   
>   If you have not used Pub/Sub Lite within the 90-day period preceding July 15, 2025 (April 15, 2025 - July 15, 2025), you won't be able to access Pub/Sub Lite starting on July 15, 2025.
> - New customers: Pub/Sub Lite is no longer available for new customers after September 24, 2024.
>
> You can migrate your Pub/Sub Lite service to
> [Google Cloud Managed Service for Apache Kafka](https://docs.cloud.google.com/pubsub/lite/docs/migrate-pubsub-lite-to-managed-service-for-apache-kafka.md.txt)
> or [Pub/Sub](https://docs.cloud.google.com/pubsub/lite/docs/migrate-pubsub-lite-to-pubsub.md.txt).

<br />

Pub/Sub Lite client libraries

This page shows how to get started with the Cloud Client Libraries for the
Pub/Sub Lite API. Client libraries make it easier to access
Google Cloud APIs from a supported language. Although you can use
Google Cloud APIs directly by making raw requests to the server, client
libraries provide simplifications that significantly reduce the amount of code
you need to write.

Read more about the Cloud Client Libraries
and the older Google API Client Libraries in
[Client libraries explained](https://docs.cloud.google.com/apis/docs/client-libraries-explained.md.txt).

## Install the client library

### Go

```
go get cloud.google.com/go/pubsublite
```

For more information, see [Setting Up a Go Development Environment](https://docs.cloud.google.com/go/docs/setup.md.txt).

### Java

If you are using [Maven](https://maven.apache.org/), add
the following to your `pom.xml` file. For more information about
BOMs, see [The Google Cloud Platform Libraries BOM](https://cloud.google.com/java/docs/bom).

```java
<!-- {x-version-update-start:google-cloud-pubsublite:current} -->
<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-pubsublite</artifactId>
  <version>1.17.1-SNAPSHOT</version>
</dependency>
<!-- {x-version-update-end} -->
<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-pubsub</artifactId>
  <version>1.151.0</version>
</dependency>
```

If you are using [Gradle](https://gradle.org/),
add the following to your dependencies:

```java
implementation 'com.google.cloud:google-cloud-pubsublite:1.17.0'
```

If you are using [sbt](https://www.scala-sbt.org/), add
the following to your dependencies:

```java
libraryDependencies += "com.google.cloud" % "google-cloud-pubsublite" % "1.17.0"
```

If you're using Visual Studio Code or IntelliJ, you can add client libraries to your
project using the following IDE plugins:

- [Cloud Code for VS Code](https://docs.cloud.google.com/code/docs/vscode/client-libraries.md.txt)
- [Cloud Code for IntelliJ](https://docs.cloud.google.com/code/docs/intellij/client-libraries.md.txt)

The plugins provide additional functionality, such as key management for service accounts. Refer
to each plugin's documentation for details.

> [!NOTE]
> **Note:** Cloud Java client libraries do not currently support Android.

For more information, see [Setting Up a Java Development Environment](https://docs.cloud.google.com/java/docs/setup.md.txt).

### Python

```
pip install --upgrade google-cloud-pubsublite
```

For more information, see [Setting Up a Python Development Environment](https://docs.cloud.google.com/python/docs/setup.md.txt).

<br />

## Set up authentication

To authenticate calls to Google Cloud APIs, client libraries support [Application Default Credentials (ADC)](https://docs.cloud.google.com/docs/authentication/application-default-credentials.md.txt); the libraries look for credentials in a set of defined locations and use those credentials to authenticate requests to the API. With ADC, you can make credentials available to your application in a variety of environments, such as local development or production, without needing to modify your application code.

For production environments, the way you set up ADC depends on the service
and context. For more information, see [Set up Application Default Credentials](https://docs.cloud.google.com/docs/authentication/provide-credentials-adc.md.txt).

For a local development environment, you can set up ADC with the credentials
that are associated with your Google Account:

1.
   [Install](https://docs.cloud.google.com/sdk/docs/install) the Google Cloud CLI, and then
   [sign in to the gcloud CLI with your federated identity](https://docs.cloud.google.com/iam/docs/workforce-log-in-gcloud.md.txt).

   After signing in,
   [initialize](https://docs.cloud.google.com/sdk/docs/initializing) the Google Cloud CLI by running the following command:

   ```bash
   gcloud init
   ```
2.

   Create local authentication credentials for your user account:

   ```bash
   gcloud auth application-default login
   ```


   If an authentication error is returned, confirm that you have
   [signed in to the gcloud CLI with your federated identity](https://docs.cloud.google.com/iam/docs/workforce-log-in-gcloud.md.txt).


   A sign-in screen appears. After you sign in, your credentials are stored in the
   [local credential file used by ADC](https://docs.cloud.google.com/docs/authentication/application-default-credentials.md.txt#personal).

## Additional resources

### Go

- [API Reference Documentation](https://docs.cloud.google.com/go/docs/reference/cloud.google.com/go/pubsublite/latest.md.txt)
- [Source Code](https://github.com/googleapis/google-cloud-go/tree/main/pubsublite)
- [GitHub Issue Tracker](https://github.com/googleapis/google-cloud-go/issues?q=is:issue+api:+pubsublite+)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-pubsublite+go)

### Java

- [API Reference Documentation](https://docs.cloud.google.com/java/docs/reference/google-cloud-pubsublite/latest/overview.md.txt)
- [Source Code](https://github.com/googleapis/java-pubsublite)
- [GitHub Issue Tracker](https://github.com/googleapis/java-pubsublite/issues)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-pubsublite+java)

### Python

- [API Reference Documentation](https://docs.cloud.google.com/python/docs/reference/pubsublite/latest.md.txt)
- [Source Code](https://github.com/googleapis/python-pubsublite)
- [GitHub Issue Tracker](https://github.com/googleapis/python-pubsublite/issues)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/google-cloud-pubsublite+python)

<br />


## Additional Pub/Sub Lite API libraries

| Language | Library |
|---|---|
| Java | [java-pubsublite-kafka](https://github.com/googleapis/java-pubsublite-kafka) |
| Java | [java-pubsublite-spark](https://github.com/googleapis/java-pubsublite-spark) |
| Java | [java-pubsub-group-kafka-connector](https://github.com/googleapis/java-pubsub-group-kafka-connector) |

<br />