> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

You can replicate data from a Salesforce Marketing Cloud instance to a
[supported destination](https://docs.cloud.google.com/datastream/docs/destinations), such as
BigQuery or Cloud Storage, by using Datastream. To prepare
your source, you create an installed package with a server-to-server API
integration, grant read permissions to your objects, and generate OAuth 2.0
credentials.

## Before you begin

Before you start configuring Salesforce Marketing Cloud for use with
Datastream, you need to:

- Have access to an active Salesforce Marketing Cloud instance.
- Have knowledge of how to navigate and change settings in Salesforce Marketing Cloud.

## Configure Salesforce Marketing Cloud for use with Datastream

To establish a connection between your Salesforce Marketing Cloud instance and
Datastream, you need to generate API credentials.
Datastream uses these credentials to facilitate secure,
authenticated communication using the server-to-server OAuth 2.0 flow.

Follow these steps in your Salesforce Marketing Cloud instance to generate the
necessary API credentials:

1. In the Salesforce Marketing Cloud interface, navigate to the **Setup** menu.
2. In the sidebar, go to **Platform Tools \> Apps \> Installed Packages**.
3. Click **New** at the top right of the page to create a new package.
4. In the **New Package Details** dialog, enter a name and a description for your package in the corresponding fields, and then click **Save**.
5. In the details page for your newly created package, click **Add Component**.
6. Select **API Integration** as the component type, and then click **Next**.
7. Select the **Server-to-Server** integration type, and then click **Next**.
8. Under **Scope** , define the required permissions. Make sure you provide **Read** permissions to all objects that you want Datastream to replicate.
9. Click **Save**.
10. Salesforce Marketing Cloud generates your credentials. Make sure that you store the **Client ID** and **Client Secret** in a secure location. You need these when you create a Salesforce Marketing Cloud connection profile.
11. Click **Finish**.
12. Take note of the **subdomain** name for your instance. You can find it in the **Authentication Base URI** section of the **API Integration** page. The subdomain is the string between the `https://` and `.auth.marketingcloudapis.com/` parts of the URI. For example, if your URI is `https://SUBDOMAIN.auth.marketingcloudapis.com/`, then your subdomain name is `SUBDOMAIN`. You need the subdomain name when you create a Salesforce Marketing Cloud connection profile.

## What's next

- Learn more about the [Salesforce Marketing Cloud source](https://docs.cloud.google.com/datastream/docs/sources-salesforce-marketing-cloud).
- Learn how to create a [Salesforce Marketing Cloud](https://docs.cloud.google.com/datastream/docs/create-connection-profiles#cp4salesforcemarketingcloud) connection profile.