clerk / clerk-sdk-python

52 stars 15 forks source link

Create/Retrieve User Metadata #28

Closed vijaystroup closed 1 month ago

vijaystroup commented 1 month ago

Unable to create metadata when creating a user. Also unable to retrieve metadata after putting it in from Clerk Dashboard.

password = secrets.token_urlsafe(15)
user = s.users.create(
  first_name='John',
  last_name='Doe',
  email_address=['john.doe@example.com'],
  password=password,
  public_metadata={
    'expires': '123',
    'organization': '456'
  }
)

Successfully creates the user however metadata is empty. Goes the same for public, private, or unsafe.

After I then add metadata to the user from the Clerk Dashboard and try to retrieve it, it is empty.

user.public_metadata.dict()

# {}
simplesagar commented 1 month ago

Hey @vijaystroup will take a look at this and get back to you soon !

speakeasybot commented 1 month ago

Hi @vijaystroup. The API has been updated to allow for arbitrary metadata fields. Please try out https://github.com/clerk/clerk-sdk-python/tree/v1.1.0 and let us know if you run into further issues. Thanks !

speakeasybot commented 1 month ago

Closing out, but please feel free to re-open if the issue persists.