startTabSynching()

Othent JS SDK startTabSynching() function

If and only if you set the persistLocalStorage option to persist and/or sync user details across tabs, you need to call startTabSynching() and make sure the cleanup function it returns is called once you no longer need the Othent instance you've created.

API

startTabSynching(): void;

Example usage

import { Othent } from "@othent/kms";

const MyComponent = () => {
  const othent = useMemo(() => {
    return new Othent(options);
  }, [options]);

  useEffect(() => {
    const cleanupFn = othent.startTabSynching();

    return () => {
      cleanupFn();
    };
  }, [othent]);
}

Last updated