Setting up client libraries

This page shows how to install client libraries for the Memorystore for Redis API so you can connect to the API with the language of your choice.

Installing the client library

C++

See Setting up a C++ development environment for details about this client library's requirements and install dependencies.

C#

Install the Google.Cloud.Redis.V1 package in Visual Studio

Go

go get cloud.google.com/go/redis/apiv1

Java

If you are using Maven, add this to your pom.xml file:

<dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-redis</artifactId>
    <version>0.62.0-alpha</version>
</dependency>

If you are using Gradle, add this to your dependencies:

compile 'com.google.cloud:google-cloud-redis:0.62.0-alpha'

If you are using SBT, add this to your dependencies:

libraryDependencies += "com.google.cloud" % "google-cloud-redis" % "0.62.0-alpha"

If you're using VS Code, IntelliJ, or Eclipse, you can add client libraries to your project using these IDE plugins:

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

Node.js

npm install --save @google-cloud/redis

PHP

composer require google/cloud-redis

Python

For more on setting up your Python development environment, refer to Python Development Environment Setup Guide.
pip install --upgrade google-cloud-redis

Ruby

gem install google-cloud-redis

Setting up authentication

  1. Install the Google Cloud CLI, then initialize it by running the following command:

    gcloud init
  2. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    A sign-in screen appears. After you sign in, your credentials are stored in the local credential file used by ADC.

Additional Resources