B2B Saas Authentication

/

Mobile SDKs

/

React Native SDK reference

/

Members

/

Update Member (Deprecated)

Update Member (Deprecated)

This method is deprecated. Please use the Update Self method to update the logged-in Member, or use the new Update Member method to update other Members.

The Update Member method wraps the Update Member API endpoint. Use this method to update the Member's name, untrusted metadata, MFA phone number, and MFA enrollment status.

You can listen for successful Member updates anywhere in the codebase with the stytch.organization.onMemberChange() method or useStytchMember hook.


Method parameters


namestring

untrusted_metadataobject

mfa_phone_numberstring

mfa_enrolledboolean
import React, { useCallback } from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
import { useStytchB2BClient } from '@stytch/react/b2b';

export const UpdateMember = () => {
  const stytch = useStytchB2BClient();

  const updateName = useCallback(() => {
    stytch.member.update({
      name: 'Jane Doe',
      untrusted_metadata: {
        display_theme: 'DARK_MODE',
      },
    });
  }, [stytch]);

  return (
    <>
      <View>
        <TouchableOpacity onPress={updateName}>
          <Text>Update name</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": {...}
}