---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [clients](../index.md) / createMrtB2CClient

# Function: createMrtB2CClient()

> **createMrtB2CClient**(`config`, `auth`): [`MrtB2CClient`](../type-aliases/MrtB2CClient.md)

Defined in: [packages/b2c-tooling-sdk/src/clients/mrt-b2c.ts:151](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/clients/mrt-b2c.ts#L151)

Creates a typed Managed Runtime B2C Commerce API client.

This client handles the B2C Commerce integration endpoints, which manage
the connection between MRT targets/environments and B2C Commerce instances.

## Parameters

### config

[`MrtB2CClientConfig`](../interfaces/MrtB2CClientConfig.md)

MRT B2C client configuration

### auth

[`AuthStrategy`](../../auth/interfaces/AuthStrategy.md)

Authentication strategy (typically ApiKeyStrategy)

## Returns

[`MrtB2CClient`](../type-aliases/MrtB2CClient.md)

Typed openapi-fetch client

## Examples

```ts
// Create MRT B2C client with API key auth
const apiKeyStrategy = new ApiKeyStrategy(apiKey, 'Authorization');

const client = createMrtB2CClient({}, apiKeyStrategy);

// Get B2C organization info
const { data, error } = await client.GET('/b2c-organization-info/{organization_slug}/', {
  params: {
    path: { organization_slug: 'my-org' }
  }
});
```

```ts
// Get B2C target info
const { data, error } = await client.GET('/projects/{project_slug}/b2c-target-info/{target_slug}/', {
  params: {
    path: { project_slug: 'my-project', target_slug: 'staging' }
  }
});
```

```ts
// Update B2C target info
const { data, error } = await client.PUT('/projects/{project_slug}/b2c-target-info/{target_slug}/', {
  params: {
    path: { project_slug: 'my-project', target_slug: 'staging' }
  },
  body: {
    instance_id: 'zzxy_prd',
    sites: ['RefArch', 'SiteGenesis']
  }
});
```
