Contributing to the ForgeRock Web Login Framework

March 3, 2026 · View on GitHub

Thank you for your interest in contributing! This guide walks you through the development environment setup, workflow, and conventions.

Table of Contents

Prerequisites

ToolVersionNotes
Node.js>= 20.xWe recommend using Volta (pinned to 22.x in package.json)
pnpm>= 10.xInstall via corepack enable && corepack prepare

Getting Started

# Clone the repository
git clone https://github.com/forgerock/forgerock-web-login-framework.git
cd forgerock-web-login-framework

# Install dependencies
pnpm install

Workspace Structure

This is a pnpm monorepo with the following workspaces:

WorkspacePackage NameDescription
packages/login-widget@forgerock/login-widgetThe published npm package — widget source, Storybook stories, Vitest tests
apps/login-app@forgerock/login-appSvelteKit development & documentation app
e2e@forgerock/login-widget-e2ePlaywright end-to-end test suite

The core/ directory is not a workspace. It contains shared TypeScript modules (stores, journey logic, OAuth, i18n) consumed by both the widget and the app via path aliases ($core, $journey, $components, $locales). See core/README.md for details.

Development Workflow

Common Commands

CommandDescription
pnpm devBuild the widget, then start the SvelteKit dev app
pnpm build:widgetBuild the widget package
pnpm build:appBuild the widget and the SvelteKit app
pnpm build:releaseFull release build (widget + types)
pnpm storybookLaunch Storybook on port 6006
pnpm testRun Vitest unit tests
pnpm test:storybookRun Storybook interaction tests
pnpm ci:e2eRun Playwright E2E tests
pnpm check:lintRun Prettier + ESLint with auto-fix
pnpm check:svelteRun svelte-check on the login-app

Environment Variables

The login-app requires environment variables for connecting to a ForgeRock AM instance. Create a .env file in the repository root or set them in your shell:

VariableDescription
VITE_FR_AM_URLForgeRock AM base URL (e.g., https://openam-sdks.forgeblocks.com/am)
VITE_FR_AM_COOKIE_NAMEAM session cookie name
VITE_FR_OAUTH_PUBLIC_CLIENTOAuth 2.0 client ID
VITE_FR_REALM_PATHAM realm path

Making Changes

This project uses Changesets for release management. Every PR that changes published package behavior should include a changeset.

Creating a Changeset

# Interactive prompt to describe your change
pnpm changeset

This creates a markdown file in .changeset/ describing the change type (patch, minor, or major) and a summary. Commit this file with your PR.

When You Don't Need a Changeset

  • Documentation-only changes
  • Changes to the dev app (apps/login-app)
  • Changes to E2E tests
  • CI/tooling configuration changes

Code Style

  • Formatter: Prettier (config in .prettierrc)
  • Linter: ESLint with Svelte and Storybook plugins
  • Pre-commit: Husky + lint-staged runs Prettier and ESLint on staged files

Run manually:

pnpm check:lint

Commit Conventions

This project uses Conventional Commits enforced via Commitizen.

# Use the interactive commit prompt
pnpm commit

Commit types: feat, fix, docs, style, refactor, perf, test, chore, ci.

Pull Requests

  1. Create a feature branch from the target branch
  2. Make your changes and include a changeset if applicable
  3. Ensure pnpm check:lint and pnpm test pass locally
  4. Push your branch and open a pull request
  5. CI will run: build, lint, unit tests, Storybook tests, Chromatic visual tests, and E2E tests

© Copyright 2022-2025 Ping Identity Corporation. All Rights Reserved.