Users
If you're using the Python SDK, you will be able to reuse the instantiated archetype object that you created when starting up your app.
Create/Register a User in your backend
The Archetype Register function actually returns a VendorUser Object so you can use the return of that function as an assumed created user.
from main import archetype
user = archetype.register(
"Your-custom-uid",
email="[email protected]",
name="robinson crusoe"
)
Considerations
The UID you set for your users needs to be URL parsable so no spaces or special characters.
Examples of bad UIDs
- asdfj45 345345345 %%%
- %%%%
- !!#123. 45
Email and name are both optional arguments but will be an additional level of utility to help you identify your users for more granular analytics.
Get a User's Details
If you want to retrieve user details, call the get_details function with your custom uid to get their full details. This will return a VendorUser object if that uid exists.
from main import archetype
archetype.get_details(uid=uid)
The VendorUser object will return the following attributes.
{
"": "c695a06cf71f4d979a031ba81b103069",
"attrs": {},
"custom_uid": "sample_uid_d979a031ba81b10",
"first_seen": 1640551044.210109,
"is_new": true,
"is_trial": false, // returns true if the user is currently in a trial
"last_seen": 1640551044.210116, // UNIX timestamp of when this user was last seen using your API
"last_updated": 1640551044.210116, //UNIX timestamp of when this user was last modified
"quota": 0, // returns the available quota for this user
"start_time": 1640544385,
"status": "not_subscribed",
"tier_id": "prod_Kqm770ZwY1YI9Y",
"uid": "15e57e238e9f4030b0030fb85d6f3aec"
}
Updated 4 months ago