Skip to main content

Type Definition

Below is the type definition for the UseAmbientSessionReturn type. This is the type definition for what the useAmbientSession hook returns. It includes methods to control the session and state information about the current session.
type UseAmbientSessionReturn = {
  start: () => Promise<void>;
  pause: () => Promise<void>;
  resume: () => Promise<void>;
  cancel: () => Promise<void>;
  submit: () => Promise<void>;
  setSessionContext: (sessionContext: SessionContext) => Promise<SessionContextResponse>;
  sessionStatus: AmbientSessionStatus;
  isFetching: boolean;
  refetch: () => Promise<AmbientSession>;
};