Links
🧪

Development

Test and debug your theme

Seeing the result live

When building your page you want to see the result of your edit live.
To achieve this with Keycloakify simply edit:
import { getKcContext } from "keycloakify";
​
const { kcContext } = getKcContext({
+ "mockPageId": "login.ftl"
});
then if you run yarn start you will see your login page display. Dont forget to remove mockPageId before releasing 😉.
You must run yarn build && npx keycloakify at least once before testing your theme with yarn start or you will end up with this.
The page is loaded with a default mock context.
To customize the mock kcContext please refer to this example.

Testing in a real Keycloak instance

Once you are done developping you want to test in an actual Keycloak instance to see if everything is working as expected.
Please refer to the related instruction printed on the console when running yarn keycloak in your project.
The instruction for starting a test container are displayed when you build the theme.