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

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

# Function: createSlasClient()

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

Defined in: [packages/b2c-tooling-sdk/src/clients/slas-admin.ts:141](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/clients/slas-admin.ts#L141)

Creates a typed SLAS Admin API client.

Returns the openapi-fetch client directly, with authentication
handled via middleware. This gives full access to all openapi-fetch
features with type-safe paths, parameters, and responses.

## Parameters

### config

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

SLAS client configuration

### auth

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

Authentication strategy (typically OAuth)

## Returns

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

Typed openapi-fetch client

## Examples

```ts
// Create SLAS client with OAuth auth
const oauthStrategy = new OAuthStrategy({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  scopes: ['SLAS_ORGANIZATION_ADMIN']
});

const client = createSlasClient(
  { shortCode: 'kv7kzm78' },
  oauthStrategy
);

// Create or update a SLAS client
const { data, error } = await client.PUT('/tenants/{tenantId}/clients/{clientId}', {
  params: {
    path: { tenantId: 'your-tenant', clientId: 'new-client-id' }
  },
  body: {
    clientId: 'new-client-id',
    name: 'My SLAS Client',
    channels: ['RefArch'],
    scopes: ['sfcc.products', 'sfcc.catalogs'],
    redirectUri: ['http://localhost:3000/callback'],
    secret: '',
    isPrivateClient: true
  }
});
```

```ts
// List all clients for a tenant
const { data, error } = await client.GET('/tenants/{tenantId}/clients', {
  params: { path: { tenantId: 'your-tenant' } }
});
```
