UNPKG

@databutton/liveblocks-client

Version:

**At [Liveblocks](https://liveblocks.io), we’re building tools to help companies create world-class collaborative products that attract, engage and retain users.** This repository is a set of open-source packages for building performant and reliable multi

28 lines (27 loc) 835 B
import { ClientOptions, Client } from "./types"; /** * Create a client that will be responsible to communicate with liveblocks servers. * * @example * const client = createClient({ * authEndpoint: "/api/auth" * }); * * // It's also possible to use a function to call your authentication endpoint. * // Useful to add additional headers or use an API wrapper (like Firebase functions) * const client = createClient({ * authEndpoint: async (room) => { * const response = await fetch("/api/auth", { * method: "POST", * headers: { * Authentication: "token", * "Content-Type": "application/json" * }, * body: JSON.stringify({ room }) * }); * * return await response.json(); * } * }); */ export declare function createClient(options: ClientOptions): Client;