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@beta
pnpm install xstate@beta
yarn add xstate@beta
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';