B2B Saas Authentication

/

Mobile SDKs

/

React Native SDK reference

/

Session Management

/

Revoke Sessions for Member

Revoke sessions for Member

Wraps Stytch's revoke Session endpoint and revokes all Sessions for a given Member.


Response fields


request_idstring

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

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

  const revokeSessions = useCallback(() => {
    stytch.session.revokeForMember({ member_id: 'member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f' });
  }, [stytch]);

  return (
    <View>
      <TouchableOpacity onPress={revokeSessions}>
        <Text>Revoke sessions</Text>
      </TouchableOpacity>
    </View>
  );
};

RESPONSE

200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141"
}