---
sidebar_position: 50
description: How to configure a Google Cloud Storage retriever.
---
import { integrations } from "@site/data/integrations";
import {Mandatory, NotMandatory} from "@site/src/components/checks/checks";
export const retrieverName = 'Google Cloud Storage'
export const info = integrations.retrievers.find((r) => r.name === retrieverName)

# Google Cloud Storage

## Overview
{info.longDescription ?? info.description}

The [**Google Cloud Storage Retriever**](https://pkg.go.dev/github.com/thomaspoignant/go-feature-flag/retriever/gcstorageretriever/#Retriever) will use the [`google-cloud-storage package`](https://pkg.go.dev/cloud.google.com/go/storage) and [`google-api-options package`](https://pkg.go.dev/google.golang.org/api/option) to access your flag in Google Cloud Storage.

## Configure the relay proxy

To configure your relay proxy to use the {retrieverName} retriever, you need to add the following
configuration to your relay proxy configuration file:

```yaml title="goff-proxy.yaml"
# ...
retrievers:
  - kind: googleStorage
    bucket: 2093u4pkasjc3
    object: flags.yaml
# ...
```

| Field name |   Mandatory   | Type   | Default  | Description                                                                                                     |
|------------|:-------------:|--------|----------|-----------------------------------------------------------------------------------------------------------------|
| `kind`     | <Mandatory /> | string | **none** | Value should be **`googleStorage`**.<br/>_This field is mandatory and describes which retriever you are using._ |
| `bucket`   | <Mandatory /> | string | **none** | This is the name of your Google Storage bucket _(ex: `my-featureflag-bucket`)_.                                 |
| `object`   | <Mandatory /> | string | **none** | Path to the file inside the bucket _(ex: `config/flag/my-flags.yaml`)_.                                         |

:::info
If you want to authenticate with Google Cloud, you can use the default environment variable `GOOGLE_APPLICATION_CREDENTIALS` to provide your credentials.
We recommend using GCP native authentication methods.

Check [this documentation for more info](https://cloud.google.com/docs/authentication).
:::

## Configure the GO Module
To configure your GO module to use the {retrieverName} retriever, you need to add the following
configuration to your `ffclient.Config{}` object:

```go title="example.go"
err := ffclient.Init(ffclient.Config{
    PollingInterval: 3 * time.Second,
    Retriever: &gcstorageretriever.Retriever{
	    Options: []option.ClientOption{option.WithoutAuthentication()},
		Bucket: "2093u4pkasjc3",
		Object: "flags.yaml",
	}
})
defer ffclient.Close()
```


| Field        |    Mandatory     | Description                                                                                                                                                                     |
|--------------|:----------------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`Bucket`** |  <Mandatory />   | The name of your bucket.                                                                                                                                                        |
| **`Object`** |  <Mandatory />   | The name of your object in your bucket.                                                                                                                                         |
| **`Option`** | <NotMandatory /> | An instance of `option.ClientOption` that configures your access to Google Cloud. <br/> Check [this documentation for more info](https://cloud.google.com/docs/authentication). |
