How to run Okta in production mode in a React app

Hello,

I’m building a SPA with React using Okta. I deployed a prototype in production and got this warning:

The link, as suggested by the warning, shows me how to include the minified CDN, however, i’m not loading Okta using a CDN but i installed the package through NPM (again, this is a react.js app).

So how do i accomplish this exactly? Thanks :slight_smile:

Hi @Fieel

When installing the package through npm, there are two different js files available under /dist/js: okta-sign-in.js and okta-sign-in.min.js. In order to remove the console message, the minified version needs to be loaded:

import OktaSignIn from '@okta/okta-signin-widget/dist/js/okta-sign-in.min'

@dragos I’m using the default import as shown in the react-okta tutorials:

import OktaSignIn from '@okta/okta-signin-widget';

Should I update it?

Hi @Fieel

Yes, please update it and try it out.