{"id":21496939,"url":"https://github.com/financial-times/ef-runtime","last_synced_at":"2025-08-17T13:13:43.968Z","repository":{"id":194261278,"uuid":"688015857","full_name":"Financial-Times/ef-runtime","owner":"Financial-Times","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-15T10:29:40.000Z","size":913,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-08-04T13:54:27.226Z","etag":null,"topics":["extensible-frontends"],"latest_commit_sha":null,"homepage":"","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/Financial-Times.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-06T13:27:32.000Z","updated_at":"2025-07-15T10:29:45.000Z","dependencies_parsed_at":"2023-10-11T01:42:24.326Z","dependency_job_id":"efe6c903-02f7-4598-b8cf-25c68643a243","html_url":"https://github.com/Financial-Times/ef-runtime","commit_stats":null,"previous_names":["financial-times/ef-runtime"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/Financial-Times/ef-runtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fef-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fef-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fef-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fef-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Financial-Times","download_url":"https://codeload.github.com/Financial-Times/ef-runtime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Financial-Times%2Fef-runtime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270852059,"owners_count":24656808,"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-08-17T02:00:09.016Z","response_time":129,"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":["extensible-frontends"],"created_at":"2024-11-23T16:19:55.492Z","updated_at":"2025-08-17T13:13:43.943Z","avatar_url":"https://github.com/Financial-Times.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extensible Frontends Runtime Client\n\nA runtime library designed to help host apps initialise the runtime on the client-side and dynamically load components from an external component registry.\n\n## Table of Contents\n\n- [About](#about)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n- [Usage](#usage)\n  - [Initialisation](#initialisation)\n- [Running Tests](#running-tests)\n- [FAQ](#faq)\n\n## About\n\nThis client-side runtime library is part of the Extensible Frontends project. It enables host applications to initialise a runtime environment that can dynamically load and manage components from an external component registry.\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js\n- npm or yarn\n\n### Installation\n\nInstall the package using npm or yarn:\n\n```bash\nnpm install ef-runtime-client\n```\n\n## Usage\n\n### Initialisation\n\nTo initialise the runtime, provide the system code for your host application:\n\n```js\nimport * as EFRuntime from \"ef-runtime-client\";\n\nEFRuntime.init({ systemCode: \"ef-demo-host\" });\n```\n\nIf needed, you can override specific entries in the component registry. Specify separate URLs for JavaScript and CSS like so:\n\n```js\nEFRuntime.init({\n  systemCode: \"ef-demo-host\",\n  overrides: {\n    \"my-component\": {\n      js: \"http://localhost:3000/my-component.js\",\n      css: \"http://localhost:3000/my-component.css\",\n    },\n  },\n});\n```\n\n### Using the Extensible Frontends Overrides UI\n\nInstead of modifing the init function in the page's code, you can use the Extensible-Frontends override UI to test your component locally. To do so, You can add the key `efui` to your browser's localStorage manually and set its value to \"true\" or by running the following command in your browser's console:\n\n``` js\nlocalStorage.setItem(\"efui\", \"true\")\n```\n\nIf the `EFUI` button is showing in the page you are developing and you would like to disable it, simple remove the key from your browser's localStorage manually or by running the following command in your browser's console:\n\n``` js\nlocalStorage.removeItem(\"efui\")\n```\n\n### Custom Logging\n\nThe runtime allows you to implement custom logging. You can utilize this feature to integrate your own logging system or to assist in debugging. Pass a logging object during initialisation with custom functions for `info`, `warn`, `error`, and `debug`.\n\nHere's an example:\n\n```js\nEFRuntime.init({\n  systemCode: \"ef-demo-host\",\n  logging: {\n    info: (message, ...args) =\u003e customLogger.info(message, ...args),\n    warn: (message, ...args) =\u003e customLogger.warn(message, ...args),\n    error: (message, ...args) =\u003e customLogger.error(message, ...args),\n    debug: (message, ...args) =\u003e customLogger.debug(message, ...args),\n  },\n});\n```\n\nIf you do not provide specific functions, default console methods are used for errors, and other logs are suppressed.\n\n## Running Tests\n\nExecute the test suite with the following command:\n\n```bash\nnpm test\n```\n\n## FAQ\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinancial-times%2Fef-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinancial-times%2Fef-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinancial-times%2Fef-runtime/lists"}