> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# createPlatformClient

***

> **createPlatformClient**(): `PlatformClient`

Creates a platform client.

This is the entry point of the Platform SDK in the browser. Import it from `@base44/platform`.
The client gives your white-label app editor access to the platform's modules, such as
[`chat`](https://docs.base44.com/developers/references/platform-sdk/docs/interfaces/chat). It takes no options and
doesn't connect to anything. Each call to
[`client.chat.init()`](https://docs.base44.com/developers/references/platform-sdk/docs/interfaces/chat#init) gets a
socket session from the `getSession()` function you pass in. On your backend, use
[`createPlatformServer()`](https://docs.base44.com/developers/references/platform-sdk/docs/functions/createPlatformServer)
from `@base44/platform/server`.

## Returns

`PlatformClient`

The platform client, with one property for each module.

A new platform client.

> **Properties**
>
> **chat** `ChatModule` *required*
>
> [Chat module](https://docs.base44.com/developers/references/platform-sdk/docs/interfaces/chat.md) for following the AI chat of your users' apps.

#### Example

```typescript Create a client for your app editor theme={null}
import { createPlatformClient } from '@base44/platform';

const client = createPlatformClient();

// Use the client to follow the AI chat in an app
const chat = client.chat.init({
  async getSession() {
    const response = await fetch('/api/chat-socket-session', { method: 'POST' });
    return response.json();
  },
  onError: (error) => console.error('Live updates error', error.code),
});
await chat.connect();
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.