/auth
Search
⌃K
Comment on page

createUser( )

Function to create a user. Users are scoped at the app-level.

Usage

const { data } = await client.user.createUser({
wallet: '0x123....efg',
});
​
console.log('User Wallet: ', data?.wallet);

Return Value

{
data?: {
id: string;
clientID: string;
organizationID?: string;
wallet: string;
nickname?: string;
roles: string[];
metadata?: ObjectMap;
createdAt: string;
updatedAt: string;
};
error: ErrorMessage | null;
headers: Object;
statusCode: number;
}

Configuration

wallet (optional)

String that represents a wallet address.
const { data } = await client.user.createUser({
wallet: '0x123....efg',
});
​
console.log('User Wallet: ', data?.wallet);

email (optional)

String that represents an email.
const { data } = await client.user.createUser({
});
​
console.log('User Wallet: ', data?.wallet);

phoneNumber (optional)

String that represents a phone number.
const { data } = await client.user.createUser({
phoneNumber: '415-830-5678',
});
​
console.log('User Wallet: ', data?.wallet);

nickname (optional)

String that represents a nickname.
const { data } = await client.user.createUser({
nickname: 'Mike Smith',
});
​
console.log('User Wallet: ', data?.wallet);

metadata (optional)

String that represents any additional data.
const { data } = await client.user.createUser({
nickname: 'Mike Smith',
metadata: {
'home_state': 'california',
},
});
​
console.log('User Wallet: ', data?.wallet);