chore(javascript): create client configs more explicitly - #133
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
71503ce to
77f807e
Compare
77f807e to
81dd340
Compare
vatsalparikh
left a comment
There was a problem hiding this comment.
Looks great, overall! Just one question
0026f0c
81dd340 to
0026f0c
Compare
|
Applied the changes to the rest of the sample apps. Needs one more approval from someone. |
|
@ancheetah , this is unrelated to your PR. While reviewing Chris' PR I noticed that we mention Chris' docs PR: Todo API .env.example: |
0026f0c to
8fbc16a
Compare
|
@vatsalparikh I went ahead and updated |
vatsalparikh
left a comment
There was a problem hiding this comment.
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.
The
.env.exampletemplate was missing theVITE_SDK_CONFIGvariable (a JSON string) which allows one to configure the application solely through the.envwithout the use of unified JSON. This PR replaces it withVITE_SDK_<NAME>variables and additionally rewrites the creation of the configuration object(s) inconstants.jsto 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):
[New] Config with standard variables: