# Functions the SDK calls (CartConnector and callbacks)

> STEP 3-2

These are the functions the SDK calls. The SDK user implements them and passes them to `init()` ([Options you can pass](./shopify-headless-reference-init.html#options-you-can-pass)). Their roles are in the [SDK reference list](./shopify-headless-reference.html#methods-and-callbacks).

## `CartConnector` (always implement it)

A pair of two functions that you pass to `cart` in `init`. The SDK reads and writes your cart through these two functions ([Why a `CartConnector` is needed](./shopify-headless-cart-connector.html#why-a-cartconnector-is-needed)).

- [`getCart()`](./shopify-headless-reference-get-cart.html)
- [`updateCheckoutPlusLines(change)`](./shopify-headless-reference-update-checkout-plus-lines.html)

## Callbacks

When you pass these to `init`, they are called when the SDK's state changes.

- [`onCheckoutPlusLinesChange`](./shopify-headless-reference-on-checkout-plus-lines-change.html)
- [`onError`](./shopify-headless-reference-on-error.html)
