> ## 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.

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# 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`](/developers/references/platform-sdk/docs/interfaces/chat). It takes no options and
doesn't connect to anything. Each call to
[`client.chat.init()`](/developers/references/platform-sdk/docs/interfaces/chat#init) gets a
socket session from the `getSession()` function you pass in. On your backend, use
[`createPlatformServer()`](/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.

<Accordion title="Properties">
  <ResponseField name="chat" type="ChatModule" required>
    [Chat module](/developers/references/platform-sdk/docs/interfaces/chat) for following the AI chat of your users' apps.
  </ResponseField>
</Accordion>

#### Example

<CodeGroup>
  ```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();
  ```
</CodeGroup>


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