This guide provides step-by-step instructions on migrating to the latest version of the Monite React SDK. Please read carefully and ensure all steps are followed to avoid potential issues.
The @monite/sdk-api package has been deprecated.
All API calls are now part of the main @monite/sdk-react package.
You will need to uninstall the deprecated package and update the imports.
If your code uses deprecated methods, replace them with the new recommended alternatives as detailed in the changelog.
MoniteProvider syntaxThe @monite/sdk-api package has been deprecated.
All API calls are now part of the main @monite/sdk-react package.
Also, the MoniteSDK object that was used to initialize the MoniteProvider has been removed.
The MoniteProvider.monite prop now expects a plain JavaScript object instead of a MoniteSDK instance.
The following example shows the old and new syntaxes.
palette is now colors. The palette object has been replaced by a flatter colors object.
Color definitions are now a single string value instead of an object with main and contrastText.borderRadius and spacing have been added to control general UI metrics.Follow these steps to convert your old customTheme object to the new format.
palette → colors)The palette object is now colors.
You’ll need to map your old color values to the new, simplified keys:
main value from your old color objects (e.g. palette.primary.main).colors.primary).The typography object is similar but has key differences in its variants and value types.
fontSize and fontWeight should now be numbers, not strings (e.g. 500 not "500").
lineHeight remains a string with a px unit.button have been removed in favor of more semantic names like body1 or body2.
You’ll need to map your old styles to the most appropriate new variant.Add the new borderRadius and spacing properties at the top level of your theme object.
You can use the default values to start.
The following properties from the old Material UI theme are no longer supported:
palette.mode: The light/dark mode toggle is not supported anymore.palette.*.contrastText: The new colors object does not have a field for contrasting text color. This is now handled internally.palette.background.paper: This is simplified to colors.background.palette.text.secondary: This is simplified to colors.text.typography.button: This variant has been removed. Use body1 or body2 instead.typography.*.textTransform: This CSS property can no longer be configured through the theme.Here is a full conversion of the sample customTheme from the old format to the new format.
If you encounter any issues during or after the migration, refer to the full Monite SDK documentation for usage tips and FAQs.
For further assistance, contact our support team.