> For the complete documentation index, see [llms.txt](https://docs.keycloakify.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keycloakify.dev/testing-your-theme/outside-of-keycloak-without-storybook.md).

# Outside of Keycloak - Without Storybook

This option for testing your theme is a fallback option if you prefer avoiding introducing Storybook into your project.

To do that, just uncomment the following lines in [your entrypoint](#user-content-fn-1)[^1]:

<pre class="language-typescript" data-title="src/[main|index].tsx?"><code class="lang-typescript">import { createRoot } from "react-dom/client";
import { StrictMode } from "react";
import { KcPage } from "./kc.gen";

// The following block can be uncommented to test a specific page with `yarn dev`
// Don't forget to comment back or your bundle size will increase
<strong>// */
</strong>import { getKcContextMock } from "./login/KcPageStory";

if (import.meta.env.DEV) {
    window.kcContext = getKcContextMock({
        pageId: "register.ftl",
        overrides: {}
    });
}
<strong>// */
</strong>
...
</code></pre>

The `pageId` parameter of the `getKcContextMock` lets you decide what page you want to test.\
The overrides parameter lets you modify the default kcContext mock for the page.\
\
For example you can overwrite the `kcContext.locale.currentLanguageTag` to preview your page in a different language.

<pre class="language-tsx"><code class="lang-tsx">window.kcContext = getKcContextMock({
  pageId: "login.ftl",
<strong>  overrides: {
</strong><strong>    locale: {
</strong><strong>      currentLanguageTag: "zh-CN",
</strong><strong>    },
</strong><strong>  },
</strong>});
</code></pre>

Then start the dev server of your, project:

```bash
npm run dev
# Or 'npm run start' (CRA) or 'npm run serve' (Angular Webpack)
```

<figure><img src="https://2643300760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Ls5iTdfTS2xECgBfw90%2Fuploads%2Fgit-blob-4069467bbca5d989acb8d46aec3cfa6aee0fa74a%2Fimage%20(86).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
When you're done testing, don't forget to comment back the import of the mock. Forgetting to do so will negatively impact the bundle size of your pages.
{% endhint %}

[^1]: Your entrypoint is one of the following depending of your Framwork:

    * src/main.tsx
    * src/index.tsx
    * src/main.ts
    * src/index.ts
    * src/main.ts


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keycloakify.dev/testing-your-theme/outside-of-keycloak-without-storybook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
