Keycloakify
HomeGitHubStorybookAlternative to keycloak-js
v11 (Legacy)
  • Documentation
  • Release Notes & Upgrade Instructions
  • FAQ
v11 (Legacy)
  • 👨‍💻Quick start
  • 🧪Testing your Theme
    • In Storybook
    • In a Keycloak Docker Container
    • With Vite or Webpack in dev mode
  • 🔩Integrating Keycloakify in your Codebase
    • In your React Project
      • In your Vite Project
      • In your Webpack Project
    • As a Subproject of your Monorepo
      • Turborepo
      • Nx Integrated Monorepo
      • Package Manager Workspaces
  • 🎨Customization Strategies
    • CSS Level Customization
      • Basic example
      • Removing the default styles
      • Applying your own classes
      • Page specific styles
      • Using Tailwind
      • Using custom assets
        • .css, .sass or .less
        • CSS-in-JS
    • Component Level Customization
      • Using custom assets
  • 🖋️Custom Fonts
  • 🌎Internationalization and Translations
    • Base principles
    • Adding Support for Extra Languages
    • Previewing you Pages In Different Languages
    • Adding New Translation Messages Or Changing The Default Ones
  • 🎭Theme Variants
  • 📝Customizing the Register Page
  • 👤Account Theme
    • Single-Page
    • Multi-Page
  • 📄Terms and conditions
  • 🖇️Styling a Custom Page Not Included In Base Keycloak
  • 🔧Accessing the Server Environment Variables
  • 🎯Targetting Specific Keycloak Versions
  • 📧Email Customization
  • 🚛Passing URL Parameters to your Theme
  • 🤵Admin theme
  • 📥Importing the JAR of Your Theme Into Keycloak
  • 🔛Enabling your Theme in the Keycloak Admin Console
  • 🤓Taking ownership of the kcContext
  • 📖Configuration Options
    • --project
    • keycloakVersionTargets
    • environmentVariables
    • themeName
    • startKeycloakOptions
    • themeVersion
    • postBuild
    • XDG_CACHE_HOME
    • kcContextExclusionsFtl
    • keycloakifyBuildDirPath
    • groupId
    • artifactId
    • Webpack specific options
      • projectBuildDirPath
      • staticDirPathInProjectBuildDirPath
      • publicDirPath
  • FAQ & HELP
    • 🤝Comunity resources
    • ⬆️Migration Guides
      • ⬆️v10->v11
      • ⬆️v9 -> v10
      • ⬆️CRA -> Vite
      • ⬆️v8 -> v9
      • ⬆️v7 -> v8
      • ⬆️v6 -> v7
      • ⬆️v6.x -> v6.12
      • ⬆️v5 -> v6
    • 😞Can't identify the page to customize?
    • 🤔How it Works
    • 😖Some values you need are missing from in kcContext type definitions?
    • ❓Can I use it with Vue or Angular
      • Angular
    • ⚠️Limitations
    • 🛑Errors Keycloak in Logs
    • 🙋How do I add extra pages?
    • 🤓Can I use react-hooks-form?
    • 🚀Redirecting your users to the login/register pages
    • 💟Contributing
    • 🍪Google reCaptcha and End of third-party Cookies
    • 🔖Accessing the Realm Attributes
  • ⭐Sponsors
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. FAQ & HELP
  2. Migration Guides

CRA -> Vite

Was this helpful?

Starting with Keycloakify 9.4 Vite is now supported by Keycloakify! 🥳

That being said it will remain compatible with WebPack for the forseeable future.

If you wish to upgrade your theme that was based on here is what you need to do:

  • Clone the new starter and copy/paste your src and public directories as well as your index.html into it.

  • Rename the src/index.tsx into src/main.tsx

  • Check if you have modified other parts since you cloned the original starter

  • The build directory is now dist and the build_keycloak directory is now dist_keycloak update your .github/workflow/ci.yaml file and your Dockerfile to reflect theses changes. If you haven't changed anything you can just keep things as they are in the new starter.

  • If you are hosting you app on GitHub pages, don't forget to report your homepage field from your old package.json to the new one. You also want to specify a base option in the vite.config.ts if your app was hosted under a subpath which is the case with the default GitHub Page domains (<username>.github.io/<project name>)

  • Of course report all the dependencies you might had added in the the new package.json

  • Storybook has been upgraded to v8, have a look at the story in the new starters. They are slightly different.

  • You can remove the src/PUBLIC_URL.ts file if you used one. You can now simply use import.meta.env.BASE_URL to reference assets in your public directory like: <img src={`${import.meta.env.BASE_URL}foo.png`} />

  • You now don't have to specify a XDG_CACHE_HOME in your CI. There is a improved builtin cache mechanism in v9.4 that dramatically improve build speed. you must also provide it to the yarn build script.

  • (OPTIONAL) You might want to move your Keycloakify configuration from your package.json to your vite.config.ts. You just need to move your keycloakify field in your package.json to the argument of the Keycloakify vite plugin. See for examples.

⬆️
⬆️
the CRA starter project
If you still provide the XDG_CACHE_HOME var env
here
🔩Integrating Keycloakify in your Codebase