# Function createRivetKitWithClient

- createRivetKitWithClient<Registry extends AnyActorRegistry>(
  client: Client<Registry>,
  opts?: CreateRivetKitOptions<Registry>,
  ): {
  useActor: <ActorName extends string | number | symbol>(
  opts: ActorOptions<Registry, ActorName>,
  ) => {
  connection:
  | ActorConn<ExtractActorsFromRegistry<Registry>[ActorName]>
  | null;
  error: Error | null;
  handle: ActorHandle<ExtractActorsFromRegistry<Registry>[ActorName]> | null;
  hash: string;
  isConnected?: boolean;
  isConnecting?: boolean;
  isError?: boolean;
  opts: {
  createInRegion?: string;
  createWithInput?: unknown;
  enabled?: boolean;
  key: string | string[];
  name: keyof ExtractActorsFromRegistry<Registry>;
  params?: Record<string, string>;
  };
  useEvent: (eventName: string, handler: (...args: any[]) => void) => void;
  };
  }

  #### Type Parameters

  - Registry extends AnyActorRegistry

  #### Parameters

  - client: Client<Registry>
  - opts: CreateRivetKitOptions<Registry> = {}

  #### Returns {
  useActor: <ActorName extends string | number | symbol>(
  opts: ActorOptions<Registry, ActorName>,
  ) => {
  connection:
  | ActorConn<ExtractActorsFromRegistry<Registry>[ActorName]>
  | null;
  error: Error | null;
  handle: ActorHandle<ExtractActorsFromRegistry<Registry>[ActorName]> | null;
  hash: string;
  isConnected?: boolean;
  isConnecting?: boolean;
  isError?: boolean;
  opts: {
  createInRegion?: string;
  createWithInput?: unknown;
  enabled?: boolean;
  key: string | string[];
  name: keyof ExtractActorsFromRegistry<Registry>;
  params?: Record<string, string>;
  };
  useEvent: (eventName: string, handler: (...args: any[]) => void) => void;
  };
  }

  - ##### useActor: <ActorName extends string | number | symbol>(
    opts: ActorOptions<Registry, ActorName>,
    ) => {
    connection:
    | ActorConn<ExtractActorsFromRegistry<Registry>[ActorName]>
    | null;
    error: Error | null;
    handle: ActorHandle<ExtractActorsFromRegistry<Registry>[ActorName]> | null;
    hash: string;
    isConnected?: boolean;
    isConnecting?: boolean;
    isError?: boolean;
    opts: {
    createInRegion?: string;
    createWithInput?: unknown;
    enabled?: boolean;
    key: string | string[];
    name: keyof ExtractActorsFromRegistry<Registry>;
    params?: Record<string, string>;
    };
    useEvent: (eventName: string, handler: (...args: any[]) => void) => void;
    }

  - Defined in react/src/mod.ts:27