Add a package sdk-vanilla to the repository#176
Closed
lyleschemmerling wants to merge 3 commits intoFusionAuth:mainfrom
Closed
Add a package sdk-vanilla to the repository#176lyleschemmerling wants to merge 3 commits intoFusionAuth:mainfrom
lyleschemmerling wants to merge 3 commits intoFusionAuth:mainfrom
Conversation
Fixes FusionAuth#175 Add a new package `sdk-vanilla` to the repository to provide FusionAuth SDK for vanilla JavaScript with web components. * **Package Metadata and Configuration** - Add `package.json` with package metadata, scripts, dependencies, and build configuration. - Add `vite.config.ts` for Vite build configuration. * **Web Components** - Add `fa-account.ts` to implement the `fa-account` web component with a button to redirect to the user's account management page. - Add `fa-login.ts` to implement the `fa-login` web component with a button to redirect to the /app/login endpoint and start the OAuth flow. - Add `fa-logout.ts` to implement the `fa-logout` web component with a button to redirect to the /app/logout endpoint. - Add `fa-register.ts` to implement the `fa-register` web component with a button to redirect to the /app/register endpoint. * **FusionAuthService** - Add `FusionAuthService.ts` to implement the `FusionAuthService` class with methods for login, register, logout, manage account, fetch user info, refresh token, auto-refresh, and post-redirect handling. - Store and retrieve configuration from localStorage. * **Documentation** - Add `README.md` with instructions and examples on how to use the `sdk-vanilla` package. * **Tests** - Add tests for `FusionAuthService` in `FusionAuthService.test.ts`. - Add tests for web components in `fa-account.test.ts`, `fa-login.test.ts`, `fa-logout.test.ts`, and `fa-register.test.ts`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/FusionAuth/fusionauth-javascript-sdk/issues/175?shareId=XXXX-XXXX-XXXX-XXXX).
There was a problem hiding this comment.
Copilot reviewed 5 out of 14 changed files in this pull request and generated no comments.
Files not reviewed (9)
- packages/sdk-vanilla/package.json: Language not supported
- packages/sdk-vanilla/src/components/fa-register.test.ts: Evaluated as low risk
- packages/sdk-vanilla/src/FusionAuthService.test.ts: Evaluated as low risk
- packages/sdk-vanilla/src/FusionAuthService.ts: Evaluated as low risk
- packages/sdk-vanilla/src/components/fa-account.test.ts: Evaluated as low risk
- packages/sdk-vanilla/src/components/fa-account.ts: Evaluated as low risk
- packages/sdk-vanilla/src/components/fa-login.test.ts: Evaluated as low risk
- packages/sdk-vanilla/README.md: Evaluated as low risk
- packages/sdk-vanilla/vite.config.ts: Evaluated as low risk
lyleschemmerling
commented
Feb 7, 2025
| </script> | ||
| </head> | ||
| <body> | ||
| <fa-login></fa-login> |
Author
There was a problem hiding this comment.
please add all component buttons to this example
…ll request * **New `sdk-vanilla` package** - Add the package to the repository - Include specified web components (`fa-account`, `fa-login`, `fa-logout`, `fa-register`) and a `FusionAuthService` typescript class - Implement the `FusionAuthService` class to handle intermediate functions and use the same functions from the core package as the other SDKs - Match the styles of the web components with the existing SDKs - Add a `vite.config.ts` file to build the library - Create documentation and a `README.md` file with instructions and examples on how to use the `sdk-vanilla` package - Update the `FusionAuthService` class to store the config in localStorage and pull the config from localStorage before making any requests - Ensure each of the "start" methods in the service uses `getConfig` before making requests - Remove the need for components to pass a config into the constructor for the service - Add tests for the `FusionAuthService` class and the web components
mmanes
requested changes
Feb 7, 2025
| </script> | ||
| </head> | ||
| <body> | ||
| <fa-login></fa-login> |
There was a problem hiding this comment.
Please add all component buttons to this example
Author
|
Please add build scripts for yalc in the top-level package.json for sdk-vanilla |
…s for sdk-vanilla * **README.md** - Add a section to address new comments - Include details about the new `sdk-vanilla` package, documentation updates, and additional examples - Mention performance optimizations and styling updates for web components - Update Vite configuration and tests for `FusionAuthService` and web components * **package.json** - Add `sdk-vanilla` to workspaces - Add build script for `sdk-vanilla` - Add yalc publish script for `sdk-vanilla` - Update test script to include `sdk-vanilla`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #175
Add a new package
sdk-vanillato the repository to provide FusionAuth SDK for vanilla JavaScript with web components.Package Metadata and Configuration
package.jsonwith package metadata, scripts, dependencies, and build configuration.vite.config.tsfor Vite build configuration.Web Components
fa-account.tsto implement thefa-accountweb component with a button to redirect to the user's account management page.fa-login.tsto implement thefa-loginweb component with a button to redirect to the /app/login endpoint and start the OAuth flow.fa-logout.tsto implement thefa-logoutweb component with a button to redirect to the /app/logout endpoint.fa-register.tsto implement thefa-registerweb component with a button to redirect to the /app/register endpoint.FusionAuthService
FusionAuthService.tsto implement theFusionAuthServiceclass with methods for login, register, logout, manage account, fetch user info, refresh token, auto-refresh, and post-redirect handling.Documentation
README.mdwith instructions and examples on how to use thesdk-vanillapackage.Tests
FusionAuthServiceinFusionAuthService.test.ts.fa-account.test.ts,fa-login.test.ts,fa-logout.test.ts, andfa-register.test.ts.For more details, open the Copilot Workspace session.