> ## 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.

# @stytch/vanilla-js v5

> Documentation for vanilla-js v5

<Note>The following only apply to @stytch/vanilla-js v5 and below. We recommend upgrading to v6 to receive new features by following [the upgrade guide](/api-reference/b2b/frontend-sdks/vanilla-js/upgrade-guide).</Note>

This page documents old APIs used in @stytch/vanilla-js v5. APIs not described on this page are unchanged in v6.

## StytchB2BUIClient and StytchB2BHeadlessClient

If you are using Stytch UI, use `StytchB2BUIClient`, otherwise use `StytchB2BHeadlessClient` from `@stytch/vanilla-js/b2b/headless` for smaller bundle size.

```js theme={null}
// For Stytch UI
import { StytchB2BUIClient } from '@stytch/vanilla-js/b2b';

// Without Stytch UI
import { StytchB2BHeadlessClient } from '@stytch/vanilla-js/b2b/headless';
```

### Imports

These imports are only available in `@stytch/vanilla-js/b2b` in v5 and should be imported separately from `@stytch/react` or `@stytch/nextjs`.

* `B2BProducts`
* Types for most SDK methods and configuration

## Mounting

If you are using React or Next.js, pass the `StytchB2BUIClient` into `<StytchB2BProvider>`.

```jsx theme={null}
<StytchB2BProvider stytch={stytch}>
  // Your app here
</StytchB2BProvider>
```

If you are only using `@stytch/vanilla-js`, use the `mount` functions on the client. `elementId` is a selector matching an element on the page to mount Stytch UI to. Make sure this element is included in your HTML file before the script tag containing your Stytch configuration.

```js theme={null}
// Stytch login
stytch.mount({
  elementId: '#stytch-sdk',
  styles,
  callbacks,
  config,
  strings,
});

// Stytch identity provider
stytch.mountIdentityProvider({
  elementId: '#stytch-idp-container',
  styles,
});
```

## Styles

<img src="https://mintcdn.com/stytch-34ca0595/_VZ7xuxCWE_nuHaZ/images/api-reference/shared/sdk/v5-ui-login.png?fit=max&auto=format&n=_VZ7xuxCWE_nuHaZ&q=85&s=46b7a30682cd0420082656af9d4615eb" alt="Stytch UI v5 login component" style={{ maxWidth: "450px" }} width="752" height="906" data-path="images/api-reference/shared/sdk/v5-ui-login.png" />

The style object allows you to customize the look of the SDK. You can specify
some of them or none at all. We'll use our defaults for the ones you don't
specify.

<ParamField path="fontFamily" type="string">
  The font family that will apply to all text in the SDK.
</ParamField>

<ParamField path="hideHeaderText" type="boolean">
  When this value is true, the title and description text will not show in the SDK.
</ParamField>

<ParamField path="container" type="object">
  The configuration object for the Stytch UI container.

  <Expandable title="properties">
    <ParamField path="width" type="string">
      The width of the SDK container.
    </ParamField>

    <ParamField path="backgroundColor" type="string">
      The background color of the SDK container.
    </ParamField>

    <ParamField path="borderColor" type="string">
      The border color of the SDK container.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="colors" type="object">
  The configuration object for colors used in the Stytch UI components.

  <Expandable title="properties">
    <ParamField path="primary" type="string">
      Your primary brand color. This will be applied to most of the text in the SDK.
    </ParamField>

    <ParamField path="secondary" type="string">
      Your secondary brand color. This will be applied to text disclaimers and other visual elements.
    </ParamField>

    <ParamField path="success" type="string">
      A success color to be used in visual elements.
    </ParamField>

    <ParamField path="error" type="string">
      An error color to be used in visual elements.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="buttons" type="object">
  The configuration object for buttons in the Stytch UI component.

  <Expandable title="properties">
    <ParamField path="primary" type="object">
      The configuration object for primary buttons.

      <Expandable title="properties">
        <ParamField path="textColor" type="string">
          The text color of the primary button.
        </ParamField>

        <ParamField path="backgroundColor" type="string">
          The background color of the primary button.
        </ParamField>

        <ParamField path="borderColor" type="string">
          The border color of the primary button.
        </ParamField>

        <ParamField path="borderRadius" type="string">
          The border radius of the primary button.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField path="secondary" type="object">
      The configuration object for secondary buttons.

      <Expandable title="properties">
        <ParamField path="textColor" type="string">
          The text color of the secondary button.
        </ParamField>

        <ParamField path="backgroundColor" type="string">
          The background color of the secondary button.
        </ParamField>

        <ParamField path="borderColor" type="string">
          The border color of the secondary button.
        </ParamField>

        <ParamField path="borderRadius" type="string">
          The border radius of the secondary button.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>

  <ParamField path="inputs" type="object">
    The configuration object for text inputs in the Stytch UI components.

    <Expandable title="properties">
      <ParamField path="textColor" type="string">
        The text color of the text inputs.
      </ParamField>

      <ParamField path="backgroundColor" type="string">
        The background color of the text inputs.
      </ParamField>

      <ParamField path="placeholderColor" type="string">
        The color of the placeholder text in the text inputs.
      </ParamField>

      <ParamField path="borderColor" type="string">
        The border color of the text inputs.
      </ParamField>

      <ParamField path="borderRadius" type="string">
        The border radius of the text inputs.
      </ParamField>
    </Expandable>
  </ParamField>
</ParamField>

<ParamField path="logo" type="object">
  The configuration object for your custom logo.

  <Expandable title="properties">
    <ParamField path="logoImageUrl" type="string">
      The URL of your custom logo. The image will be resized to fit a max height of 50px, and a max width of 100px.
    </ParamField>
  </Expandable>
</ParamField>
