Skip to main content

useClient

This useClient hook returns your instance of CollabClient

The client can be used for things like authentication, binding events, and any other functionality on the class.

import { useClient } from '@pdftron/collab-react'
export function LoginButton() {
const client = useClient();
const login = async () => {
await client.loginAnonymously("Greg");
}
return (
<div>
<button onClick={login}>Login</button>
</div>
)
}