• Preparing search index...
  • The search index is not available
Lens SDK Reference
  • Lens SDK Reference
  • @lens-protocol/react-web
  • Core
  • useCreateProfile

Function useCreateProfile

  • useCreateProfile(): UseDeferredTask<Profile, PendingSigningRequestError | InsufficientGasError | UserRejectedError | WalletConnectionError | TransactionError | HandleNotAvailableError | InvalidHandleError | UnspecifiedError, CreateProfileArgs>
  • Experimental

    useCreateProfile is a React Hook that allows you to create a Profile associated with a Handle.

    Returns UseDeferredTask<Profile, PendingSigningRequestError | InsufficientGasError | UserRejectedError | WalletConnectionError | TransactionError | HandleNotAvailableError | InvalidHandleError | UnspecifiedError, CreateProfileArgs>

    Example

    const { execute, loading, error } = useCreateProfile();
    

    Create a Profile

    const { execute, loading, error } = useCreateProfile();

    // ...

    const result = execute({
    localName: 'foobar', // full handle will be lens/foobar
    to: '0x1234567890123456789012345678901234567890',
    });

    if (result.isFailure()) {
    console.error(result.error);
    return;
    }

    const profile = result.value;
    console.log(profile);

    This hook is experimental and may change in future versions.

    • Defined in packages/react/src/transactions/useCreateProfile.ts:69

Settings

Member Visibility

Theme

On This Page

    • Create a Profile
Lens SDK Reference
  • @lens-protocol/react-web - v2.3.2
  • @lens-protocol/react-native - v2.3.2
  • @lens-protocol/client - v2.3.2