# useCreateNewSigner

## Description

Tis hook provides functionality for creating a new passkey signer in the context of a smart account. It handles the creation process and manages loading and error states.

## Returns

## Example

```tsx
import { useCreateNewSigner } from "@cometh/connect-react-hooks";
 
const MyComponent = () => {
 const { createSigner, isLoading, error, data } = useCreateNewSigner('your-api-key', 'https://api.example.com');
 
 const handleCreateSigner = async () => {
   try {
     const newSigner = await createSigner({
       smartAccountAddress: '0x1234...', // Replace with actual address
       passKeyName: 'MyNewPasskey'
     });
     console.log('New signer created:', newSigner);
   } catch (err) {
     console.error('Error creating signer:', err);
   }
  };

  return (
   <div>
      <button onClick={handleCreateSigner} disabled={isLoading}>
        Create New Signer
      </button>
      {isLoading && <p>Creating signer...</p>}
      {error && <p>Error: {error.message}</p>}
      {data && <p>Signer created successfully!</p>}
    </div>
  );
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cometh.io/integrations/react-hooks/handle-owners/usecreatenewsigner.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
