The Create Member method wraps the Create Member API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to create Members in other Organizations.
Create a Member
Method parameters
email_address* string
name string
untrusted_metadata object
create_member_as_pending boolean
is_breakglass boolean
mfa_phone_number string
mfa_enrolled boolean
roles array[strings]
Response fields
request_id string
status_code int
member_id string
member object
organization object
import { Text, TouchableOpacity, View } from 'react-native';
import { useStytchB2BClient } from '@stytch/react-native/b2b';
export const CreateMember = () => {
const stytch = useStytchB2BClient();
const createMember = () => {
stytch.organization.members.create({
email_address: 'sandbox@stytch.com',
});
};
return (
<View>
<TouchableOpacity onPress={createMember}>
<Text>Create a Member</Text>
</TouchableOpacity>
</View>
);
};
RESPONSE
200
{
"status_code": 200,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"member_id": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
"member": {...},
"organization": {...}
}