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

# Upgrade Guide

> How to upgrade between major versions of the SDK

# From 19 to 20

## Compatibility

<ul><li>Browser support: We support Safari mobile and desktop 16, Chrome 109 and Firefox 106.
Browsers older than this may still be able to use our SDK, but may require additional transpile and polyfills.</li>
<li>No polyfills are included since all APIs used are also supported in the versions supported.</li>
<li>Custom themes require support for [`color-mix` CSS function](https://caniuse.com/wf-color-mix).
A compatibility helper is available if you are targeting older browsers.</li></ul>

## Step by step guide

**1. Upgrade @stytch/react and remove @stytch/vanilla-js**vanilla-js is now included in `@stytch/react` and no longer a peer dependency.
Run `npm`, `yarn` or `pnpm` to install the new version.`json package.json theme={null}
"@stytch/react": "^19.0.0", // [!code --]
"@stytch/vanilla-js": "^5.0.0", // [!code --]
"@stytch/react": "^20.0.0", // [!code ++]
`**2. Update imports**Copy all imports from `@stytch/vanilla-js` to `@stytch/react`.\`\`\`js theme=
import React from 'react';
import { StytchProvider } from '@stytch/react'; // \[!code --]
import { StytchHeadlessClient, createStytchUIClient } from '@stytch/vanilla-js'; // \[!code --]
import { // [!code ++:5]
StytchHeadlessClient,
StytchProvider,
createStytchUIClient
} from '@stytch/react';

```

\**3. Update products configuration**

If `config.products` are specified as strings, update them to use `Products` instead:



      

import \\\\{ Products \\\\} from '@stytch/react'; // [!code ++]

const config = \\\\{
  products: ['oauth', 'eml'], // [!code --]
  products: [Products.oauth, Products.emailMagicLinks], // [!code ++]
\\\\};



\**4. Update styles to presentation**

![](https://mintcdn.com/stytch-34ca0595/chUftqYqk2C1W0Ql/images/api-reference/b2c/frontend-sdks/prebuilt-ui-login.png?fit=max\\&auto=format\\&n=chUftqYqk2C1W0Ql\\&q=85\\&s=173a6c425a8669bda59f083b4519708d)


The new `presentation` property now controls theming and styling options.
This differs from the previous `style` property in that it configures tokens affecting many elements rather than properties on specific elements.





We have provided a migration helper function. In development mode this function
will also print out warnings about properties that could not be migrated.





import \\\\{ styleToTheme \\\\} from '@stytch/react/compat'; // [!code ++]

const config = \\\\{
  style: \\\\{ ... \\\\}, // [!code --]
  // This will also print out the recommended migrated config // [!code ++:3]
  // which should replace this in production
  theme: styleToTheme(\\\\{ ... \\\\}),
\\\\};



For a full list of supported properties, see reference documentation for [`presentation`](./prebuilt-ui/theming#reference).



\\### `presentation.theme`





Controls CSS styling. 
Each token corresponds to some CSS properties, so each value should be a CSS value.
You can also provide an array of `[lightTheme, darkTheme]` which will automatically switch 
between the two depending on the user's OS color scheme.





\\**theme migration**

\\<table><thead><tr><th>style</th>
        \\<th>presentation.theme</th></tr></thead>
    \\<tbody><tr><td>container.backgroundColor</td>
        \\<td>background</td></tr>
      \\<tr><td>container.borderColor</td>
        \\<td>border / container-border</td></tr>
      \\<tr><td>container.borderRadius</td>
        \\<td>rounded-base / container-radius</td></tr>
      \\<tr><td>container.width</td>
        \\<td>container-width</td></tr>
      \\<tr><td>colors.primary</td>
        \\<td>primary</td></tr>
      \\<tr><td>colors.secondary</td>
        \\<td>secondary</td></tr>
      \\<tr><td>colors.accent</td>
        \\<td>accent</td></tr>
      \\<tr><td>colors.success</td>
        \\<td>success</td></tr>
      \\<tr><td>colors.warning</td>
        \\<td>warning</td></tr>
      \\<tr><td>colors.error</td>
        \\<td>destructive</td></tr>
      \\<tr><td>buttons.primary.backgroundColor</td>
        \\<td>primary</td></tr>
      \\<tr><td>buttons.primary.textColor</td>
        \\<td>primary-foreground</td></tr>
      \\<tr><td>buttons.primary.borderRadius</td>
        \\<td>rounded-base / button-radius</td></tr>
      \\<tr><td>buttons.secondary.backgroundColor</td>
        \\<td>secondary</td></tr>
      \\<tr><td>buttons.secondary.textColor</td>
        \\<td>secondary-foreground</td></tr>
      \\<tr><td>buttons.secondary.borderRadius</td>
        \\<td>rounded-base / button-radius</td></tr>
      \\<tr><td>inputs.borderColor</td>
        \\<td>input</td></tr>
      \\<tr><td>inputs.placeholderColor</td>
        \\<td>muted-foreground</td></tr>
      \\<tr><td>inputs.borderRadius</td>
        \\<td>rounded-base / input-radius</td></tr>
      \\<tr><td>fontFamily</td>
        \\<td>font-family</td></tr></tbody></table>

  

New properties:



  \\<ul><li>**color-scheme**: Declares the theme as either light or dark.</li>
    \\<li>**font-family-mono**: Font for TOTP and recovery code</li>
    \\<li>**header-font**: Font for headers</li>
    \\<li>**spacing**, **rounded-base**, **text-base**: Base units for size and spacing between items, border radius and font size</li>
    \\<li>**mobile-breakpoint**: Screen width at which input and buttons are rendered larger for touchscreen users</li>
    \\<li>**shadow**, **shadow-button**, **shadow-input**: Optional box-shadow applied to buttons and inputs</li>
    \\<li>**transition-duration**: Transition duration. Set to 0 to disable transitions</li></ul>





\\### `presentation.options`



Controls non-styling options such as the logo to display.



\\**options migration**

\\<table><thead><tr><th>style</th>
        \\<th>presentation.options</th></tr></thead>
    \\<tbody><tr><td>hideHeaderText</td>
        \\<td>hideHeaderText</td></tr>
      \\<tr><td>logo.logoImageUrl</td>
        \\<td>logo.url</td></tr></tbody></table>

  

New properties:



  \\<ul><li>**logo.alt**: Alt text for the logo</li></ul>





\\### More styling changes





These changes are unlikely to cause issues.





\\**more style changes**

\\### Component size




Stytch UI component now use `max-width` rather than `width` to make it more flexible. This means the component may render at a size smaller than expected if it is placed in a flexbox or grid. To restore previous behavior, wrap it in a `div` with your desired width.





\\\\<div style=\\\\{\\\\{ width: '400px' \\\\}\\\\}\\\\>
  \\\\<StytchLogin /\\\\>
\\\\</div\\\\>





\\### Style isolation and injection





The SDK now injects styles into the `head` element as a `style` tag. The component styling is also slightly less aggressive, so global styles may affect internal styling differently. If you would like complete style isolation, we recommend enabling shadow DOM.





const presentation = \\\\{
  options: \\\\{
    enableShadowDOM: true,
  \\\\},
\\\\};





\\### Element IDs





Some element IDs have been removed. To restore them, use `presentation.options.buttonId`. We do not recommend using the IDs to modify Stytch UI component styles or DOM.





const presentation = \\\\{
  options: \\\\{
    buttonId: true, // Or set to a string to add a suffix to make ID unique
  \\\\},
\\\\};



\**5. Update customized strings**

If you use [string customization](/api-reference/consumer/frontend-sdks/react/prebuilt-ui/text-customization),
check if you need to update these strings:



      

\\**updated strings**

\\<table><thead><tr><th>Old ID</th>
              \\<th>Old Text</th>
              \\<th>New ID</th>
              \\<th>New Text</th>
              \\<th>Notes</th></tr></thead>
          \\<tbody><tr><td>button.back.ariaLabel</td>
              \\<td>Back</td>
              \\<td>button.goBack</td>
              \\<td>Go back</td>
              \\<td>[**1**](#footnote-1)</td></tr>
            \\<tr><td>button.forgotPassword</td>
              \\<td>Forgot Password?</td>
              \\<td>(Unchanged)</td>
              \\<td>Forgot your password?</td>
              \\<td /></tr>
            \\<tr><td>password.forgot.title</td>
              \\<td>Forgot password?</td>
              \\<td>(Unchanged)</td>
              \\<td>Forgot your password?</td>
              \\<td /></tr>
            \\<tr><td>button.hidePassword</td>
              \\<td>Hide password</td>
              \\<td>(Unchanged)</td>
              \\<td>Hide</td>
              \\<td>[**1**](#footnote-1)</td></tr>
            \\<tr><td>button.showPassword</td>
              \\<td>Show password</td>
              \\<td>(Unchanged)</td>
              \\<td>Show</td>
              \\<td>[**1**](#footnote-1)</td></tr>
            \\<tr><td>button.loginWithoutPassword</td>
              \\<td>Login without a password</td>
              \\<td>(Unchanged)</td>
              \\<td>Log in without a password</td>
              \\<td /></tr>
            \\<tr><td>crypto.error.content</td>
              \\<td>Your sign in request could not be completed. Use the back arrow
to return to the log in screen and try again!</td>
              \\<td>(Unchanged)</td>
              \\<td>Your sign in request could not be completed. Go back to the main
screen and try logging in again.</td>
              \\<td /></tr>
            \\<tr><td>crypto.setupNewWallet.content</td>
              \\<td>Signing in with a crypto wallet can help keep your account
private and secure.</td>
              \\<td>(Unchanged)</td>
              \\<td>Get started by downloading any Ethereum or Solana wallet.</td>
              \\<td /></tr>
            \\<tr><td>crypto.setupNewWallet.instruction</td>
              \\<td>Get started by downloading any Ethereum or Solana wallet. We've
included a few examples of wallet extensions you can find below.
Once you've set up your wallet, you can use it to sign in!</td>
              \\<td>(Unchanged)</td>
              \\<td>We've included a few examples of wallet extensions you can find
below. Once you've set up your wallet, click "Go back" to use it
and sign in.</td>
              \\<td /></tr>
            \\<tr><td>crypto.troubleHelp</td>
              \\<td>Having trouble? Use the back arrow to return to the main screen
and try logging in again.</td>
              \\<td>(Unchanged)</td>
              \\<td>If you are having trouble, go back to the main screen and try
logging in again.</td>
              \\<td /></tr>
            \\<tr><td>oauth.continueWithTwitter</td>
              \\<td>Continue with Twitter</td>
              \\<td>oauth.continueWithX</td>
              \\<td>Continue with X</td>
              \\<td /></tr>
            \\<tr><td>passcode.codeSent / passcode.didntGetIt</td>
              \\<td>Code sent / Didn't get it?</td>
              \\<td>passcode.codeSent</td>
              \\<td>Code sent! Try again in \\\\{timeRemaining\\\\}s</td>
              \\<td /></tr>
            \\<tr><td>toast.emailResent</td>
              \\<td>Email resent</td>
              \\<td>button.emailResent</td>
              \\<td>Email resent! Try again in \\\\{timeRemaining\\\\}s</td>
              \\<td /></tr>
            \\<tr><td>password.didntGetItResend</td>
              \\<td>Didn't get it? <resendButton>Resend
email</resendButton></td>
              \\<td>button.resendEmail</td>
              \\<td>Resend email</td>
              \\<td /></tr>
            \\<tr><td>watermark.altText</td>
              \\<td>Powered by Stytch</td>
              \\<td>(Unchanged)</td>
              \\<td>Stytch by Twilio</td>
              \\<td /></tr></tbody></table>

        

\\<sup>1</sup> This was previously only for non-visual users, now it is
displayed as text.



      

You may also wish to customize these new strings:



      

\\**new strings**

\\<table><thead><tr><th>ID</th>
              \\<th>Text</th>
              \\<th>Notes</th></tr></thead>
          \\<tbody><tr><td>loading.label</td>
              \\<td>Loading</td>
              \\<td /></tr>
            \\<tr><td>emailConfirmation.emailSent</td>
              \\<td>Email sent! Try again in \\\\{timeRemaining\\\\}s</td></tr>
            \\<tr><td>password.requirement.fulfilled</td>
              \\<td>Fulfilled</td>
              \\<td>[**2**](#footnote-2)</td></tr>
            \\<tr><td>password.requirement.notFulfilled</td>
              \\<td>Not fulfilled</td>
              \\<td>[**2**](#footnote-2)</td></tr>
            \\<tr><td>password.requirement.suggestion</td>
              \\<td>Suggestion</td>
              \\<td>[**2**](#footnote-2)</td></tr>
            \\<tr><td>password.requirement.warning</td>
              \\<td>Warning</td>
              \\<td>[**2**](#footnote-2)</td></tr>
            \\<tr><td>tab.listLabel</td>
              \\<td>Select login method</td>
              \\<td>[**2**](#footnote-2)</td></tr>
            \\<tr><td>watermark.poweredBy</td>
              \\<td>Powered by</td>
              \\<td /></tr></tbody></table>

        

\\<sup>2</sup> This is an accessibility label for non-visual users.

**6. Update deprecated imports**The following are deprecated and should be updated.- `createStytchUIClient` → `createStytchClient`
- `createStytchHeadlessClient` → `createStytchClient`
- `StytchUIClient`  → `StytchClient`
- `StytchHeadlessClient`  → `StytchClient`**7. Test your changes**We recommend running through every auth method used to make sure the new theme looks correct in context. You should also take note of errors or warnings in the browser console.
```
