Wraps Stytch's revoke Session endpoint and revokes all Sessions for a given Member.
Revoke sessions for Member
Response fields
request_id string
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
status_code int
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
import React, { useCallback } from 'react';
import { useStytchB2BClient } from '@stytch/react/b2b';
export const RevokeSessionsButton = () => {
const stytch = useStytchB2BClient();
const revokeSessions = useCallback(() => {
stytch.session.revokeForMember({ member_id: 'member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f' });
}, [stytch]);
return <button onClick={revokeSessions}>Revoke sessions</button>;
};
RESPONSE 200
200
{
"status_code": 200,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141"
}
RESPONSE 401
200
{
"status_code": 401,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "unauthorized_credentials",
"error_message": "Unauthorized credentials.",
"error_url": "https://stytch.com/docs/api/errors/401"
}
RESPONSE 429
200
{
"status_code": 429,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "too_many_requests",
"error_message": "Too many requests have been made.",
"error_url": "https://stytch.com/docs/api/errors/429"
}
RESPONSE 500
200
{
"status_code": 500,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "internal_server_error",
"error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
"error_url": "https://stytch.com/docs/api/errors/500"
}