# Salesforce installation

> Installing the Safecube package in Salesforce takes seven steps, done once per Salesforce instance — install the package, assign permission sets, create a public site, then configure the API key and the endpoint.

This guide installs and configures the Safecube package in a Salesforce environment. The procedure is done only once per Salesforce instance. Using the Safecube app once installed is described in the [Salesforce user guide](/en/platform/integrations/salesforce-user-guide).

## Before you start

- The Salesforce integration is a custom add-on, not part of a Safecube plan: Safecube gives access to it on request. [Contact the Safecube team](https://app.safecube.ai/contact) before installing.
- Step 5 needs the API key of your Safecube workspace. Only an Admin or an Owner of the workspace can open it, as described in [API credentials](/en/platform/developers/api-credentials).

## 1. Install the Safecube package

Open the [Safecube package installation link](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tgK0000001qcTQAQ). Salesforce then asks to:

- log in to the Salesforce environment;
- confirm the installation of a non-Salesforce application;
- authorize `api.sinay.ai` to send container tracking data to Salesforce.

## 2. Assign the Safecube permission set

Every Salesforce user who needs Safecube must have the `Safecube` permission set:

1. Open **Setup** in Salesforce.
2. In the Quick Find box, type **Permission Sets** and select it.
3. Click the `Safecube` permission set.
4. Click **Manage Assignments**, then **Add Assignments**.
5. Select the users who need access, click **Next**, then **Assign**.

## 3. Activate a site to get a public URL

Salesforce requires a public site URL for external integrations:

1. Open **Setup** in Salesforce.
2. In the Quick Find box, type **Sites** and select it.
3. Click **New** to create a site.
4. Fill in the site information:

   | Field                 | Value          |
   | --------------------- | -------------- |
   | Site Label            | `Safecube`     |
   | Site Name             | `Safecube`     |
   | Default Web Address   | `Safecube`     |
   | Active                | Checked        |
   | Active Site Home Page | `Unauthorized` |

5. Click **Save**.

## 4. Assign the guest user permission set

A technical guest user holds the permissions on the Safecube application settings, including the API key:

1. In the Quick Find box, type **Sites** and select it.
2. Click the **Safecube** site.
3. Select **Public Access Settings**, then **View Users**.
4. Click **Site Guest User**.
5. Select **Permission Set Assignment**, then **Edit Assignments**.
6. Search for **Safecube Guest User**, click **Add**, then **Save**.

## 5. Configure the Safecube API key

The API key gives Salesforce the right to access container tracking data:

1. In the Quick Find box, type **Custom Settings** and select it.
2. Next to **Safecube Settings**, select **Manage**, then **New**.
3. In another browser tab, open the Safecube platform as an Admin or an Owner, select **Developers** in the sidebar, then the **API Credentials** tab, and select **Copy key**.
4. Back in the Safecube Settings of Salesforce, paste the API key in the **API Key** field and click **Save**.

::callout{type="warning"}
Rotating the API key in Safecube invalidates the old key at once: every request Salesforce sends to Safecube with the old key fails until you paste the new key in the **API Key** field of the Safecube Settings. Rotation is described in [API credentials](/en/platform/developers/api-credentials).
::

## 6. Set up the Safecube public URL

Safecube sends tracking data to the Salesforce instance through this public URL:

1. In the Quick Find box, type **Sites** and select it.
2. On the **Safecube** site, right-click the **Domain Name** and select **Copy link address**.
3. In the Quick Find box, type **Custom Settings** and select **Safecube Settings**.
4. Select **Manage**, then **Edit**.
5. Paste the public URL and click **Save**.

::callout{type="warning"}
Copy the domain name with **Copy link address**, not by selecting the text. A URL copied from a text selection does not work, and the endpoint cannot be created in step 7.
::

## 7. Activate the endpoint

1. Open the App Launcher, then the **Safecube** application.
2. Select the **Safecube Settings** tab.
3. Click **Create endpoint**.

The installation is complete: the Safecube container tracking app is ready to use in the Salesforce instance.

For any issue during the installation, [contact the Safecube support team](https://app.safecube.ai/contact).
