Installation
XState has zero dependencies and runs anywhere that JavaScript runs. You can install XState using your favorite package manager, like npm, pnpm, or yarn.
- npm
- pnpm
- yarn
npm install xstate
pnpm install xstate
yarn add xstate
CDN​
You can also import XState from various CDNs:
import { createMachine, createActor } from 'https://esm.run/xstate';
import { createMachine, createActor } from 'https://esm.sh/xstate';
import { createMachine, createActor } from 'https://cdn.skypack.dev/xstate';