B2B Saas Authentication

/

Frontend SDKs

/

Headless

/

Members

/

Search Members

Search Members

The Search Members method wraps the Search Members API endpoint. It can be used to search for Members within the logged-in Member's Organization.

Submitting an empty query returns all non-deleted Members within the logged-in Member's Organization.

*All fuzzy search filters require a minimum of three characters.


Method parameters


cursorstring

limitint

queryobject
import { useStytchB2BClient } from '@stytch/react/b2b';

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

  const searchMembers = async () => {
    const { members } = await stytch.organization.members.search({
      query: { operands: [{ filter_name: 'member_password_exists', filter_value: true }], operator: 'AND' },
    });
    console.log({ members });
  };

  return <button onClick={searchMembers}>Search Members</button>;
};

RESPONSE

200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "results_metadata": {
		"next_cursor": null,
		"total": 5
	},
  "members": [
    ...
  ]
  "organizations": <
    ...
  >
}