---
schema_version: "1"
id: 5278eac6375cc84279130b703967ab3217f62687b638b90cca1a432c0db2ed43
title: Client IP Forwarding
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/commerce-api/guides/client-ip-forwarding.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/client-ip-forwarding.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 41a82c2b67921d97a20c060a8475fc5dcfd8f32939a7e5bd1bbf6326228bf65e
products:
  - Composable Storefront
  - Salesforce APIs
---
# Client IP Forwarding

Forwarding Client IPs to the B2C Commerce platform is a prerequisite for services such as geolocation. You can use any of the following options to pass shopper client IPs to the B2C Commerce platform.

In Custom API implementations and hooks, access the client IP using the Script API method [Request.getRemoteAddress()](https://salesforcecommercecloud.github.io/b2c-dev-doc/docs/current/scriptapi/html/api/class_dw_system_Request.html#dw_system_Request_getHttpRemoteAddress_DetailAnchor).
**note:** This method only works correctly if one of the following options (either Shopper Context or Request Header) is implemented.

## Shopper Context

You can use the [Shopper Context API](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary) API to pass a client IP to the B2C Commerce Platform. The [client IP can be stored](https://developer.salesforce.com/docs/commerce/commerce-api/guide/shopper-context-geolocation.html#retrieve-geolocation-with-client-ip-address-and-use-for-subsequent-requests) in the shopper profile and used in subsequent requests.

## Request Header

In **Business Manager > {Your-Site} >** **Merchant Tools** > **SEO** > **Customer CDN Settings**, in the **Dynamic Content** section, configure the _Client IP Header Name_ field. For each request the B2C Commerce API will use this setting to retrieve the client IP address from the request header instead of the CDN network connection source address. If the request header isn't provided, the CDN connection source address will be used.

**note:** - If both options are used, Shopper Context takes precedence.
