---
schema_version: "1"
id: beccf469f4ef38422ea88b7f951c93c2b3c2f263f58fdc164f32d979291042b6
title: Add a Heroku Collaborator
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforce-functions/functions/guide/dev-guide/heroku-add-data-source.md
canonical_url: https://developer.salesforce.com/docs/platform/functions/guide/heroku-add-data-source.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9c540071d296caa40346511a8015ad0cdf55732e9d8cf5a332784d5b0f1023b9
products:
  - Salesforce Functions
---
# Add a Heroku Collaborator

Access a Heroku data store from within your function by adding a Heroku user as a collaborator to your function's compute environment. Add a collaborator using the `sf env compute collaborator add` command with the Heroku user's email.

Make sure you're logged into Salesforce Functions, then run:

```sh
sf env compute collaborator add --heroku-user:heroku-user@example.com
```

Using `sf env compute collaborator` triggers an email to the Heroku user letting them know you've added them as a collaborator. After running this command, the Heroku user can then attach your function's compute environment to a data store as an add-on using the Heroku CLI.

## Provide Your Collaborator with the Compute Environment Name

Use `sf env list` to get a list of compute environments and retrieve the name of your compute environment:

```sh
sf env list
```

Example output:

```sh
Type: Compute Environment
ALIAS        PROJECT NAME      CONNECTED ORG ALIAS CONNECTED ORG ID   COMPUTE ENVIRONMENT NAME
MyComputeEnv MyFunctionProject MyScratchOrgAlias   00DS0000003dRFdTAM myfunct-00ds0000003drfdpam-786
```

Find the compute environment for your org and provide its name to your collaborator.

## Create Your Data Add-On

**note:** Skip to the next step if you have an existing data add-on.

Create the Heroku data add-on that best fits your needs:

-   [Heroku Postgres](https://devcenter.heroku.com/articles/heroku-postgresql) is a reliable, robust, and scalable database, managed by Heroku. You can connect any Postgres database running in Heroku's Common Runtime, for example [Standard and Premium Postgres plans](https://www.heroku.com/managed-data-services). In addition, you can sync data from your Salesforce org to Heroku Postgres via Heroku Connect. See the Heroku Dev Center for instructions on creating a [Heroku Postgres](https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-heroku-postgres) or [Heroku Connect](https://devcenter.heroku.com/articles/quick-start-heroku-connect) add-on.
-   [Heroku Data for Redis](https://devcenter.heroku.com/articles/heroku-redis) is Heroku’s managed key-value store as a service. Redis is commonly used for caching and background job queues. See the Heroku Dev Center for instructions on creating a [Heroku Redis Add-on](https://devcenter.heroku.com/articles/heroku-redis#provisioning-the-add-on).
-   [Apache Kafka](https://devcenter.heroku.com/articles/kafka-on-heroku) is a distributed commit log for fast, fault-tolerant communication between producers and consumers using message-based topics. Kafka provides a messaging backbone and can handle billions of events and millions of transactions." See the Heroku Dev Center for instructions on creating an [Apache Kafka on Heroku Add-On](https://devcenter.heroku.com/articles/kafka-on-heroku#provisioning-the-add-on).
-   [Heroku Connect](https://devcenter.heroku.com/articles/heroku-connect) is an add-on that provides a data synchronization service between Salesforce and Heroku Postgres databases. See the Heroku Dev Center for instructions on creating a [Heroku Connect Add-On](https://devcenter.heroku.com/articles/heroku-connect#setting-up-heroku-connect).

## Find Your Data Add-On's Unique Name

Add your Heroku Data add-on to your compute environment with its unique name.

Use `heroku addons:info <type of add-on> -a <compute-environment-name>` to find the unique name for your add-on. Use `heroku-postgresql` to find the unique name for a Heroku postgres instance.

**note:** For `<type of add-on>`, use `heroku-postgresql`, `heroku-redis`, or `heroku-kafka` for your Heroku Postgres, Heroku Redis, Apache Kafka on Heroku instance, respectively.

```sh
heroku addons:info heroku-postgresql -a myfunct-00ds0000003drfdpam-786
```

Use this unique name to connect your add-on to your compute environment.

## Connect Your Data Add-On to Your Functions Compute Environment

Run `heroku addons:attach` to attach the add-on to the environment:

```sh
heroku addons:attach <example-unique-addon-name> -a <compute-environment-name>
```

For more information about attaching and detaching add-ons, see [Managing Add-ons](https://devcenter.heroku.com/articles/managing-add-ons#using-the-command-line-interface-attaching-an-add-on-to-another-app) in the Heroku Dev Center.
