Skip to content

chore(javascript): create client configs more explicitly - #133

Merged
ancheetah merged 1 commit into
mainfrom
aj-update-config
Aug 26, 2026
Merged

ancheetah merged 1 commit into
mainfrom
aj-update-config

Conversation

@ancheetah

@ancheetah ancheetah commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

The .env.example template was missing the VITE_SDK_CONFIG variable (a JSON string) which allows one to configure the application solely through the .env without the use of unified JSON. This PR replaces it with VITE_SDK_<NAME> variables and additionally rewrites the creation of the configuration object(s) in constants.js to be more explicit in order to demonstrate both configuration options and showcase some of the options available. This helps developers better understand what exactly goes into configuring clients.

Previously, we demonstrated that both the oidc and journey clients can be initialized with the same config. While that is still true, I opted to create two separate config objects for each client because now with the unified SDK config additional properties relevant to only one client or the other can be present. So it is possible that the configurations are different (even though the clients currently ignore most of these properties).

This change has only been done in the journey sample app to get initial feedback before applying the same changes to the DaVinci and OIDC sample apps.

[Old] Config with VITE_SDK_CONFIG (JSON string):

VITE_SDK_CONFIG='{"oidc":{"clientId":"WebOAuthClient","discoveryEndpoint":"https://openam-sdks.forgeblocks.com/am/
  oauth2/alpha/.well-known/openid-configuration","scopes":["openid","profile","email"],"redirectUri":"http://localho/
  st:8443/callback.html"}}'

[New] Config with standard variables:

VITE_SDK_CLIENT_ID=WebOAuthClient
VITE_SDK_DISCOVERY_ENDPOINT=https://openam-sdks.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration
VITE_SDK_SCOPE='openid profile email'

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e6d40277-499e-4057-9abb-0753c3d9471c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ancheetah
ancheetah force-pushed the aj-update-config branch 5 times, most recently from 71503ce to 77f807e Compare August 21, 2026 17:00
SteinGabriel
SteinGabriel previously approved these changes Aug 21, 2026

@SteinGabriel SteinGabriel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than one minor comment, this looks great. This is a much better way to configure the app using the .env file.
I think it makes sense applying the same changes to the DaVinci and oidc apps.

Thanks a lot, AJ!

Comment thread javascript/reactjs-todo-journey/README.md Outdated

@vatsalparikh vatsalparikh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, overall! Just one question

Comment thread javascript/reactjs-todo-journey/README.md
vatsalparikh
vatsalparikh previously approved these changes Aug 25, 2026
ryanbas21
ryanbas21 previously approved these changes Aug 25, 2026
cerebrl
cerebrl previously approved these changes Aug 25, 2026
@ancheetah

Copy link
Copy Markdown
Contributor Author

Applied the changes to the rest of the sample apps. Needs one more approval from someone.

@vatsalparikh

vatsalparikh commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@ancheetah , this is unrelated to your PR.

While reviewing Chris' PR I noticed that we mention beta as a possible realm path in our todo api .env.example file, which sounds weird. I believe it should be bravo. Would be great if you can update this in your PR because I think it's gonna be merged soon to main.

Chris' docs PR:
https://github.com/ping-rocks/devdocs-login-widget/pull/12
https://test-docs.pingidentity.com/login-widget/PR-12/login-widget/login-widget/try-it-out/reactjs-todo-login-widget/02_configure_sample.html#react-api-server-env

Todo API .env.example:
https://github.com/ForgeRock/sdk-sample-apps/blob/main/javascript/todo-api/.env.example#L6

@ancheetah

Copy link
Copy Markdown
Contributor Author

@vatsalparikh I went ahead and updated beta to bravo. Thanks for catching that.

@vatsalparikh vatsalparikh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor non-blocking comment, everything else looks good!

Tested oidc and davinci with both .env only values and config.json only values (for client id, discovery, scope). In both cases, I was able to login and logout successfuly.

Comment thread javascript/reactjs-todo-oidc/e2e/oidc-login-pingone.spec.js
@ancheetah
ancheetah merged commit 68ca5eb into main Aug 26, 2026
40 of 49 checks passed
@ancheetah
ancheetah deleted the aj-update-config branch August 26, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants