{"id":25943447,"url":"https://github.com/tobitsoftware/chayns-api","last_synced_at":"2025-03-04T07:16:42.518Z","repository":{"id":79522111,"uuid":"567671874","full_name":"TobitSoftware/chayns-api","owner":"TobitSoftware","description":"The chayns React API provides a variety of helpful features to enhance your site.","archived":false,"fork":false,"pushed_at":"2025-03-03T16:20:57.000Z","size":16122,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-03T17:28:36.979Z","etag":null,"topics":["chayns","react"],"latest_commit_sha":null,"homepage":"https://tobitsoftware.github.io/chayns-api/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TobitSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-18T09:59:54.000Z","updated_at":"2025-03-03T16:19:47.000Z","dependencies_parsed_at":"2023-12-13T10:41:53.868Z","dependency_job_id":"aa721f53-3ec3-467f-9e3b-42c659dea303","html_url":"https://github.com/TobitSoftware/chayns-api","commit_stats":null,"previous_names":[],"tags_count":150,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TobitSoftware%2Fchayns-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TobitSoftware%2Fchayns-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TobitSoftware%2Fchayns-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TobitSoftware%2Fchayns-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TobitSoftware","download_url":"https://codeload.github.com/TobitSoftware/chayns-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801253,"owners_count":20022390,"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","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":["chayns","react"],"created_at":"2025-03-04T07:16:42.049Z","updated_at":"2025-03-04T07:16:42.512Z","avatar_url":"https://github.com/TobitSoftware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [chayns react api](https://github.com/TobitSoftware/chayns-api) \u0026middot; [![license](https://img.shields.io/github/license/TobitSoftware/chayns-api.svg)]() [![GitHub pull requests](https://img.shields.io/github/issues-pr/TobitSoftware/chayns-api.svg)]() [![](https://img.shields.io/github/issues-pr-closed-raw/TobitSoftware/chayns-api.svg)]()\n\nThe chayns-api provides information and useful functions to your page. The information and functions are provided by react hooks and normal functions.\nA list of all functions and hooks can be found [here](https://tobitsoftware.github.io/chayns-api/docs).\n\n## Installation\n\nIt is recommended to setup your new chayns page with the [create-chayns-app](https://github.com/TobitSoftware/create-chayns-app).\n\n\n### Migrate old project\n1. Install chayns-api package\n```sh\n# NPM\n$ npm install chayns-api\n\n# Yarn\n$ yarn add chayns-api\n```\n\n2. Wrap your App component with the \"ChaynsProvider\" component. In all components which are under the ChaynsProvider you can use hooks and chayns functions. \n```jsx\n\u003cChaynsProvider\u003e\n   \u003cApp/\u003e\n\u003c/ChaynsProvider\u003e\n```\n\n## Example\n\n```jsx\nimport { useUser } from 'chayns-api';\n\nconst FirstName = () =\u003e {\n    const user = useUser();\n\n    return (\n        \u003cdiv\u003e{user?.firstName}\u003c/div\u003e\n    );\n}\n```\n\n## Migrate v1 to v2\n\nWhen updating to chayns-api@2 you should also update chayns-toolkit to 3.0.1 or higher (check migration guide [here](https://github.com/TobitSoftware/chayns-toolkit/tree/main?tab=readme-ov-file#-migration-v2-to-v3)).\n\nCheck urls referencing **remoteEntry.js**. The filename has been changed to **v2.remoteEntry.js**.\n\nWhen your application uses ChaynsHost with module-type you might have to add a call of **initModuleFederationSharing** as early as possible in your application (e.g. index/bootstrap). Unless your application is already embedded as module somewhere else (e.g. in a dialog).\n\n```\ninitModuleFederationSharing({ name: 'project_name' });\n```\n\n\n## Getting started\n\nMore information to setup chayns-api can be found in the [documentation](https://tobitsoftware.github.io/chayns-api/docs).\n\n## Troubleshooting\n\n```\nCan't resolve 'react-dom/client'\n```\nA warning like above can be shown when you are still using react 17.\nThis can be ignored because the react 17 api is used as fallback instead.\n\n## License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobitsoftware%2Fchayns-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobitsoftware%2Fchayns-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobitsoftware%2Fchayns-api/lists"}