Advanced Set Up options

This section includes a list of optional advanced set up options.

Location

Users logged into the same Document ID can see each other’s Presence, Cursors, Comments etc.

However, if you want to add another layer of categorization to organize users together, you can use Location.

If a Document is like a house, a Location is like a room within the house.

To learn more about Locations, check out its dedicated section here.

Contacts

When you reply to a comment, you can @mention other teammates that are added to a User's Contacts List.

To learn more about creating a User's Contacts List, read here.

Use a specific version of the Velt React SDK.

To do use a specific version of the Velt React SDK, in your VeltProvider component, set the config props object to { version: '1.0.XYZ' }.

Example:

<VeltProvider apiKey='YOUR_API_KEY' config={{ version: '1.0.126' }}>
	...
</VeltProvider>

Detect if Velt SDK is initialized

To detect if the Velt SDK is initialized, subscribe using the following method:

let subscription = client.getVeltInitState().subscribe((veltInitState: boolean | undefined) => {
	console.log('Velt Init State:', veltInitState);
});

To unsubscribe from the subscription:

subscription?.unsubscribe()

You can also the use useVeltInitState() hook:

import { useVeltInitState } from '@veltdev/react';

function YourComponent() {
    const veltInitState = useVeltInitState();
    useEffect(() => {
        console.log('Velt Init State:', veltInitState);
        if (veltInitState) {
            // Velt state is initialized, so user can perform any action here
        }
    }, [veltInitState]);
}