{"id":28273053,"url":"https://github.com/zesty-io/react-app-loader","last_synced_at":"2025-09-18T00:53:42.879Z","repository":{"id":210185482,"uuid":"406880612","full_name":"zesty-io/react-app-loader","owner":"zesty-io","description":"React component for loading a custom app via the app-sdk","archived":false,"fork":false,"pushed_at":"2024-02-14T01:08:23.000Z","size":180,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-08-09T00:45:40.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zesty-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-15T18:17:29.000Z","updated_at":"2024-02-13T07:37:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd6e89e8-6c94-4351-a831-bf8035ef7759","html_url":"https://github.com/zesty-io/react-app-loader","commit_stats":null,"previous_names":["zesty-io/react-app-loader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zesty-io/react-app-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Freact-app-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Freact-app-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Freact-app-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Freact-app-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zesty-io","download_url":"https://codeload.github.com/zesty-io/react-app-loader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesty-io%2Freact-app-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275691198,"owners_count":25510501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-21T00:17:12.535Z","updated_at":"2025-09-18T00:53:42.864Z","avatar_url":"https://github.com/zesty-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React App Loader\n\n\u003e React functional component which orchestrates the @zesty-io/app-sdk initialization\n\nZesty.io custom apps are intended to be loaded by the [manager-ui](https://github.com/zesty-io/manager-ui) which passes the users session token to the custom application once it has completed loading in an iframe. This occurs asynchronously and therefore the mounting of the custom app, which depends on this token, must be delayed until ready.\n\n## Features\n\n- **Token-Based Authentication:** Seamlessly handles the authentication process using session tokens.\n- **Single Sign-On (SSO) Support:** Offers SSO options (Google, Azure, GitHub) for user authentication.\n- **Window Message Management:** Awaits a session token from a window message.\n- **Contextual SDK Access:** Provides easy access to the SDK's functionalities through a React context.\n\n## Usage\n\nWrap your application with the `AppLoader` component to ensure proper initialization and authentication handling.\n\n```jsx\nimport { AppLoader } from \"@zesty-io/react-app-loader\";\nimport MyApp from \"./path/to/MyApp\";\n\nexport default function App() {\n  return (\n    \u003cAppLoader authServiceUrl=\"YOUR_AUTH_SERVICE_URL\"\u003e\n      \u003cMyComponent /\u003e\n    \u003c/AppLoader\u003e\n  );\n}\n```\n\n## Props\n\n- authServiceUrl (required): The URL of the authentication service.\n- authCookie (optional): The cookie key used for authentication.\n- token (optional): An initial token for authentication.\n\n## Contextual SDK Usage\n\nAccess SDK functionalities within your components using the useSDK hook.\n\n```jsx\nimport { useSDK } from '@zesty-io/react-app-loader';\n\nconst MyComponent = () =\u003e {\n  const { isAuthenticated, token, logout, request, messages } = useSDK();\n\n  // Example usage\n  useEffect(() =\u003e {\n    request('/some/endpoint')\n      .then((res) =\u003e {\n        // Handle response\n      })\n      .catch((err) =\u003e {\n        // Handle error\n      }\n  }, [])\n\n  return (\n    \u003cbutton onClick={() =\u003e logout()}\u003elogout\u003c/button\u003e\n  );\n};\n```\n\n## Additional Notes\n\nThe component automatically handles token renewal and provides a logout function.\nThe SSO options will only appear if the ssoCookieKey is provided and no token is available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesty-io%2Freact-app-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzesty-io%2Freact-app-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesty-io%2Freact-app-loader/lists"}