Versions

Added onContactSelected API Method

We have introduced the onContactSelected API method in the Contact Element. This new method allows organization clients to add selected users to their organization or document-level IAM directly.

API Method:

const contactElement = client.getContactElement();

contactElement.onContactSelected().subscribe((data: any) => {
  console.log('contact selected: ', data);
});

React Hook:

import React, { useEffect } from 'react';
import { useContactUtils, useContactSelected } from '@veltdev/react';

function YourComponent() {

  const contactUtils = useContactUtils();

  useEffect(() => {
    console.log('contactUtils: ', contactUtils);
  }, [contactUtils]);

  const onContactSelected = useContactSelected();

  useEffect(() => {
    console.log('onContactSelected: ', onContactSelected);
  }, [onContactSelected]);

  return (
    // Your component code
  );

}

API Method Response Payload:

export class UserContactSelectedPayload {
    /**
     * Selected user contact details.
     */
    contact!: UserContact;
    /**
     * Is user part of organization contact.
     */
    isOrganizationContact!: boolean;
    /**
     * Is user part of document contact.
     */
    isDocumentContact!: boolean;
    /**
     * Document access type.
     */
    documentAccessType!: string;
}