> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# useStytchB2BClient Hook

> Get the Stytch B2B client instance using the Stytch Next.js SDK

`useStytchB2BClient` is a hook that returns the Stytch client that was passed into `<StytchB2BProvider>`. Use the client to call any SDK methods. To follow React best practices, these methods should only be called in callbacks or `useEffect` hooks.

```jsx theme={null}
import { useStytchB2BClient } from '@stytch/nextjs/b2b';

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

  const handleAction = async () => {
    // Use the client to call SDK methods
    await stytch.session.authenticate({
      session_duration_minutes: 60,
    });
  };

  return <button onClick={handleAction}>Authenticate</button>;
};
```
