{"data":{"slug":"statelyai-xstate","name":"xstate","tagline":"Libraries for state machines and management in complex logic systems","github_url":"https://github.com/statelyai/xstate","owner":"statelyai","repo":"xstate","owner_avatar_url":"https://avatars.githubusercontent.com/u/61783956?v=4","primary_language":"TypeScript","stars":30111,"forks":1391,"topics":["actor-model","background-jobs","finite-state-machine","fsm","interpreter","javascript","orchestration","reactive","scxml","state","state-machine","state-machines","state-management","statechart","statecharts","typescript","visualizer","workflow","xstate"],"archived":false,"github_pushed_at":"2026-09-14T03:58:12+00:00","maintenance_label":"Very active","stars_delta_30d":121,"url":"https://www.graphcanon.com/tools/statelyai-xstate","markdown_url":"https://www.graphcanon.com/tools/statelyai-xstate.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/statelyai-xstate","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=statelyai-xstate","description":"State machines, statecharts, and actors for complex logic","homepage_url":"https://stately.ai/docs","license":"MIT","open_issues":123,"watchers":192,"ai_summary":"The xstate repository offers TypeScript-based tools for creating state machines, statecharts, and actors useful in orchestrating background jobs and managing states within applications.","readme_excerpt":"## Super quick start\n\n```bash\nnpm install xstate\n```\n\n```ts\nimport { createMachine, createActor, assign } from 'xstate';\n\n// State machine\nconst toggleMachine = createMachine({\n  id: 'toggle',\n  initial: 'inactive',\n  context: {\n    count: 0\n  },\n  states: {\n    inactive: {\n      on: {\n        TOGGLE: { target: 'active' }\n      }\n    },\n    active: {\n      entry: assign({ count: ({ context }) => context.count + 1 }),\n      on: {\n        TOGGLE: { target: 'inactive' }\n      }\n    }\n  }\n});\n\n// Actor (instance of the machine logic, like a store)\nconst toggleActor = createActor(toggleMachine);\ntoggleActor.subscribe((state) => console.log(state.value, state.context));\ntoggleActor.start();\n// => logs 'inactive', { count: 0 }\n\ntoggleActor.send({ type: 'TOGGLE' });\n// => logs 'active', { count: 1 }\n\ntoggleActor.send({ type: 'TOGGLE' });\n// => logs 'inactive', { count: 1 }\n```\n\n---\n\n<a id=\"xstate-store\"></a>","github_created_at":"2015-09-14T15:04:15+00:00","created_at":"2026-07-15T10:45:39.082981+00:00","updated_at":"2026-09-20T04:26:42.836968+00:00","categories":[{"slug":"developer-tools","name":"Developer Tools","url":"https://www.graphcanon.com/categories/developer-tools","markdown_url":"https://www.graphcanon.com/categories/developer-tools.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/developer-tools"}],"tags":[{"slug":"finite-state-machine","name":"finite-state-machine"},{"slug":"fsm","name":"fsm"},{"slug":"javascript","name":"javascript"},{"slug":"state-management","name":"state-management"},{"slug":"statechart","name":"statechart"},{"slug":"typescript","name":"typescript"},{"slug":"workflow","name":"workflow"}],"trust":{"provenance":{"is_fork":false,"github_id":42455934,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-14T06:00:26.394Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":30,"days_since_push":0,"last_release_at":"2026-09-14T02:53:51Z","stars_delta_30d":121,"open_issues_delta_30d":2},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-15T10:45:40.625Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"mcp":{"source":"repo_scan","observed_at":"2026-09-14T06:00:26.837Z","server_manifest":false},"scan":{"source":"repo_scan","observed_at":"2026-09-14T06:00:26.837Z"},"languages":{"value":["typescript","javascript"],"source":"github.language+package.json","observed_at":"2026-09-14T06:00:26.837Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-09-14T06:00:26.837Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":{"notes":["Requires a JavaScript runtime environment. TypeScript knowledge is recommended."],"min_ram_gb":null,"requires_docker":false},"constraints":{"min_ram_gb":null,"requires_docker":false},"when_to_use":["You need advanced state management capabilities that go beyond simple state transitions; xstate offers statecharts and actors which can model sophisticated workflows and scenarios.","Your application requires the visualization of state changes, thanks to the visualizer module included in xstate, enabling developers to better understand and communicate system states."],"when_not_to_use":["You are working strictly with smaller, flat-state applications that do not benefit from complex state transitions or workflows. This tool is more suited for intricate logic systems.","Your project is primarily JavaScript-based without the need for TypeScript's type safety features, as xstate is strongly integrated with TypeScript which might introduce unnecessary complexity."],"source":"enrich:decision_facts","observed_at":"2026-07-16T19:55:03.949Z"},"constraint_facets":{"min_ram_gb":null,"requires_docker":false},"decision_summary":[{"label":"Requirements","value":"Requires a JavaScript runtime environment. TypeScript knowledge is recommended."},{"label":"Adopt for","value":"xstate is ideal for developers seeking robust state machine and actor models to handle complex logic systems in TypeScript applications."},{"label":"License detail","value":"MIT License - permissive free software license that allows for use in both proprietary and open-source software, granting freedom to users and developers alike."}]}}