{"id":19808327,"url":"https://github.com/solidos/solid-logic","last_synced_at":"2026-01-24T13:30:47.777Z","repository":{"id":38190815,"uuid":"308380462","full_name":"SolidOS/solid-logic","owner":"SolidOS","description":"Core business logic of Solid OS","archived":false,"fork":false,"pushed_at":"2025-06-25T07:44:36.000Z","size":3501,"stargazers_count":13,"open_issues_count":12,"forks_count":7,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-29T02:01:44.348Z","etag":null,"topics":["running-code","typescript"],"latest_commit_sha":null,"homepage":null,"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/SolidOS.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":"2020-10-29T16:05:21.000Z","updated_at":"2025-06-25T07:44:40.000Z","dependencies_parsed_at":"2024-03-28T17:31:37.953Z","dependency_job_id":"20f8e9c9-f36a-44f5-ac8b-02e6616c591a","html_url":"https://github.com/SolidOS/solid-logic","commit_stats":{"total_commits":248,"total_committers":14,"mean_commits":"17.714285714285715","dds":0.7016129032258065,"last_synced_commit":"2ffd297a08c0118075c27cd6ebe21185b2f1b1a7"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/SolidOS/solid-logic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidOS%2Fsolid-logic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidOS%2Fsolid-logic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidOS%2Fsolid-logic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidOS%2Fsolid-logic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SolidOS","download_url":"https://codeload.github.com/SolidOS/solid-logic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidOS%2Fsolid-logic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262924955,"owners_count":23385458,"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":["running-code","typescript"],"created_at":"2024-11-12T09:13:36.401Z","updated_at":"2026-01-24T13:30:47.765Z","avatar_url":"https://github.com/SolidOS.png","language":"TypeScript","readme":"# solid-logic\n\n\u003cimg src=\"https://raw.githubusercontent.com/solid/community-server/main/templates/images/solid.svg\" alt=\"[Solid logo]\" height=\"150\" align=\"right\"/\u003e\n\n[![MIT license](https://img.shields.io/github/license/solidos/solidos)](https://github.com/solidos/solidos/blob/main/LICENSE.md)\n\n\nCore business logic of SolidOS which can be used for any webapp as well.\n\n\n# Usage\n\n## 📦 Install via npm\n\n```sh\nnpm install solid-logic rdflib\n```\n\n\u003e **Important**: `rdflib` is a peer dependency - you must install it separately.\n\n### Import in your project (ESM/TypeScript)\n\n```js\nimport { solidLogicSingleton, store, authn } from 'solid-logic';\n\n// Example usage\nconsole.log('Current user:', authn.currentUser());\n```\n\n## 🌐 Use directly in a browser\n\nBoth UMD and ESM bundles externalize rdflib to keep bundle sizes small and avoid version conflicts.\n\n## Available Files\n\n| Format | File | Usage | Global Variable |\n|--------|------|-------|----------------|\n| UMD | `dist/solid-logic.js` | Development | `window.SolidLogic` |\n| UMD | `dist/solid-logic.min.js` | Production | `window.SolidLogic` |\n| ESM | `dist/solid-logic.esm.js` | Development | Import only |\n| ESM | `dist/solid-logic.esm.min.js` | Production | Import only |\n\n### UMD Bundle (Script Tags)\n\n**⚠️ Important**: Load rdflib **before** solid-logic or you'll get `$rdf is not defined` errors.\n\n```html\n\u003c!-- 1. Load rdflib first (creates window.$rdf) --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/rdflib/dist/rdflib.min.js\"\u003e\u003c/script\u003e\n\n\u003c!-- 2. Load solid-logic (expects $rdf to exist) --\u003e\n\u003cscript src=\"https://unpkg.com/solid-logic/dist/solid-logic.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n\t// Access via global variable\n\tconst { solidLogicSingleton, store, authn } = window.SolidLogic;\n\t\n\t// Example usage\n\tconsole.log('Store:', store);\n\tconsole.log('Authentication:', authn.currentUser());\n\u003c/script\u003e\n```\n\n### ESM Bundle (Native Modules)\n\n```html\n\u003cscript type=\"module\"\u003e\n\timport * as $rdf from 'https://esm.sh/rdflib';\n\timport { solidLogicSingleton, store, authn } from 'https://esm.sh/solid-logic@4.0.1';\n\n\t// Example usage\n\tconsole.log('Store:', store);\n\tconsole.log('Authentication:', authn.currentUser());\n\u003c/script\u003e\n```\n\n### ESM with Import Maps (Recommended)\n\n```html\n\u003cscript type=\"importmap\"\u003e\n{\n\t\"imports\": {\n\t\t\"rdflib\": \"https://esm.sh/rdflib\",\n\t\t\"solid-logic\": \"https://esm.sh/solid-logic@4.0.1\"\n\t}\n}\n\u003c/script\u003e\n\u003cscript type=\"module\"\u003e\n\timport * as $rdf from 'rdflib';\n\timport { solidLogicSingleton, store, authn } from 'solid-logic';\n\n\t// Example usage - cleaner imports!\n\tconsole.log('Store:', store);\n\tconsole.log('Authentication:', authn.currentUser());\n\u003c/script\u003e\n```\n\n## Common Exports\n\n```js\nimport { \n\tsolidLogicSingleton,  // Complete singleton instance\n\tstore,                // RDF store\n\tauthn,                // Authentication logic\n\tauthSession,          // Authentication session\n\tACL_LINK,            // ACL constants\n\tgetSuggestedIssuers,  // Identity provider suggestions\n\tcreateTypeIndexLogic, // Type index functionality\n\t// Error classes\n\tUnauthorizedError,\n\tNotFoundError,\n\tFetchError\n} from 'solid-logic';\n```\n\n# How to develop\n\nCheck the scripts in the `package.json` for build, watch, lint and test.\n\n# Used stack\n\n* TypeScript + Babel\n* Jest\n* ESLint\n* Webpack\n\n# How to release\n\nChange version and push directly to main. This will trigger the npm release latest script in CI.\n\n# History\n\nSolid-logic was a move to separate business logic from UI functionality so that people using different UI frameworks could use logic code. \n\nIt was created when the \"chat with me\" feature was built. We needed to share logic between chat-pane and profile-pane (which was part of solid-panes back then I think) due to that feature. The whole idea of it is to separate core solid logic from UI components, to make logic reusable, e.g. by other UI libraries or even non web apps like CLI tools etc. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidos%2Fsolid-logic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidos%2Fsolid-logic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidos%2Fsolid-logic/lists"}