# Build your integration

> What a developer builds to connect a shop to Releva, in order. Get the keys, install Releva on your platform, send the catalog and orders, handle consent, then check that the data arrives.

This page lists what you build to connect a shop to Releva, in the order to build it. Each step links to the page with the details. If your shop runs on a platform with a Releva app or plugin, step 2 does most of the work for you.

## The minimum that makes Releva work

Releva’s recommendations and personalization need four things. Build them first:

1. The base `Releva.push()` call on every page of your storefront: who the visitor is and what is in their cart.
2. `product.id` on product pages, in the same call.
3. Your products, sent to Releva and kept current.
4. Your paid orders, sent to Releva.

On a platform with a Releva app or plugin, installing it covers the browser part. On a custom website, you build all four. Everything else on this page improves results but is not needed to go live. One exception: if data protection law applies to your shop, handle consent (step 4) before you go live.

## 1. Get your keys

Every shop has two keys on **Settings › Shop & Integration**, on the **General** tab:

* The **Access Token** identifies your shop in the browser and in apps. It appears in your page source by design.
* The **Secret Key** authenticates your server’s calls. Keep it on your server only.

Mixing up the two keys is the most common integration error. Both are UUIDs, so they look alike.

* [Find your Access Token and Secret Key](https://releva.ai/documentation/guides/shop-settings/find-your-api-keys/)
* [Authentication, errors and limits](https://releva.ai/documentation/reference/get-started/authentication-errors-and-limits/): the base URL, how to send each key, status codes and the 800 KB body limit.
* [How Releva connects to your shop](https://releva.ai/documentation/learn/shop-settings/how-releva-connects-to-your-shop/)

## 2. Install Releva on your platform

Pick your platform. Each page covers the install, what the app or plugin sends, and a check at the end.

* Store platforms: [Shopify](https://releva.ai/documentation/integrations/shopify/connect-your-shopify-store/), [OpenCart](https://releva.ai/documentation/integrations/opencart/connect-your-opencart-store/), [PrestaShop](https://releva.ai/documentation/integrations/prestashop/connect-your-prestashop-store/), [WooCommerce](https://releva.ai/documentation/integrations/woocommerce/connect-your-woocommerce-store/), [Magento 2](https://releva.ai/documentation/integrations/magento/magento-2/), [Magento 1](https://releva.ai/documentation/integrations/magento/magento-1/) and [MerchantPro](https://releva.ai/documentation/integrations/merchantpro/install-the-releva-app/).
* Regional platforms: [CloudCart](https://releva.ai/documentation/integrations/cloudcart/connect-your-cloudcart-store/), [CS-Cart](https://releva.ai/documentation/integrations/cs-cart/connect-your-cs-cart-store/) and [GombaShop or Shopiko](https://releva.ai/documentation/integrations/gombashop/connect-your-gombashop-store/).
* A shop on your own stack: [Connect your custom website](https://releva.ai/documentation/integrations/custom-website/connect-your-custom-website/), with the [JavaScript SDK reference](https://releva.ai/documentation/integrations/custom-website/javascript-sdk-reference/).
* A mobile app: [Mobile SDKs overview](https://releva.ai/documentation/integrations/mobile/mobile-sdks-overview/).

Install Releva only once per page. Do not add the JavaScript snippet by hand on a shop where a Releva app or plugin already loads it.

## 3. Send your catalog and orders

These calls run on your server with the **Secret Key**. Check your platform’s page first: an app or plugin may already send some of them. The product ids you send here must be the same ids your storefront sends in `product.id` and in the cart. That is what ties browsing to your catalog.

| Call                                                                                           | When you call it                                                                                                                | Needed?             |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| [Create or update products](https://releva.ai/documentation/reference/catalog/create-or-update-products/)       | Whenever a product changes: price, stock, name or custom fields                                                                 | Required            |
| [Report paid orders](https://releva.ai/documentation/reference/orders/report-paid-orders/)                      | When an order is paid                                                                                                           | Required            |
| [Let Releva pull your catalog](https://releva.ai/documentation/reference/catalog/let-releva-pull-your-catalog/) | An endpoint you build. Releva calls it on a schedule to read your whole catalog and repair anything a missed update left stale. | Recommended         |
| [Report refunds](https://releva.ai/documentation/reference/orders/report-refunds/)                              | When an order is refunded                                                                                                       | If you take refunds |
| [Update product availability](https://releva.ai/documentation/reference/catalog/update-product-availability/)   | When only a product’s availability changes                                                                                      | Optional            |
| [Delete a product](https://releva.ai/documentation/reference/catalog/delete-a-product/)                         | When a product is gone for good                                                                                                 | Optional            |
| [Send order status updates](https://releva.ai/documentation/reference/orders/send-order-status-updates/)        | When an order’s status changes in your shop                                                                                     | Optional            |

## 4. Handle consent and subscriptions

Build the parts that apply to your shop:

* **Tracking consent.** If data protection law applies, pass your visitor’s consent state to the SDK. See [Pass your consent state](https://releva.ai/documentation/integrations/custom-website/connect-your-custom-website/#4-pass-your-consent-state).

* **Marketing subscriptions.** If you send e-mail or text messages with Releva, tell Releva when a customer opts in or out. Start with [Choose a consent call](https://releva.ai/documentation/reference/consent/choose-a-consent-call/), then:

  * [Subscribe a customer](https://releva.ai/documentation/reference/consent/subscribe-a-customer/) from your server.
  * [Subscribe from the browser](https://releva.ai/documentation/reference/consent/subscribe-from-the-browser/) for a sign-up form on your storefront.
  * [Set up double opt-in](https://releva.ai/documentation/reference/consent/set-up-double-opt-in/) if customers must confirm by e-mail.
  * [Unsubscribe a customer](https://releva.ai/documentation/reference/consent/unsubscribe-a-customer/) when they opt out in your systems.

* **Registrations.** Call [Record a registration](https://releva.ai/documentation/reference/profiles/record-a-registration/) when a customer creates an account.

## 5. Check that it works

1. Open a page of your shop with your browser’s developer tools on the **Network** tab, filtered to `push`. Each page sends one `POST` to `https://releva.ai/api/v0/push/` followed by your Access Token, and it answers `200`.
2. Follow [Check that your store data arrives](https://releva.ai/documentation/integrations/check-that-your-store-data-arrives/) to find your page views, products and customers in the Releva admin.
3. For a mobile app, follow [Check that your mobile app is connected](https://releva.ai/documentation/integrations/mobile/check-that-your-mobile-app-is-connected/).

When the checks pass, Releva has what it needs. Next, you can send events that are specific to your business with [Send custom events](https://releva.ai/documentation/reference/events/send-custom-events/).

## Next steps

* [Find your Access Token and Secret Key](https://releva.ai/documentation/guides/shop-settings/find-your-api-keys/): Copy the two keys before you write any code.
* [Authentication, errors and limits](https://releva.ai/documentation/reference/get-started/authentication-errors-and-limits/): Learn the rules every call shares before your first request.
* [Connect your custom website](https://releva.ai/documentation/integrations/custom-website/connect-your-custom-website/): Follow the full setup if your shop runs on its own stack.
* [Check that your store data arrives](https://releva.ai/documentation/integrations/check-that-your-store-data-arrives/): Confirm in the admin that events, products and customers reach Releva.