# Machine versions # Machine definition version operations. Machine definition versions contain the actual machine definition, which consists of a single self-contained javascript file that default exports an [XState](https://xstate.js.org/docs/) state machine as well as an `allowRead` and `allowWrite` function. They are immutable and identified by an ID. The `clientInfo` field is informational only and intended to be used to identify the source of the machine version (e.g. git commit sha, semantic version number, timestamp, etc). The `allowRead` and `allowWrite` functions are called to authorize read and write operations on machine instances, respectively. Write authorization implies the authority to read the result of your write. Anything stored in the machine's context under the `public` key will be exposed to authorized readers and writers as `publicContext`. ## Example machine definition ```js import type { AllowRead, AllowWrite, } from "@statebacked/machine-def"; import { createMachine } from "xstate"; export const allowRead: AllowRead = ( { machineInstanceName, authContext }, ) => machineInstanceName === authContext.sub; export const allowWrite: AllowWrite = ( { machineInstanceName, authContext }, ) => machineInstanceName === authContext.sub; export default createMachine(...); ``` ## Operations - [List the machine versions for this machine](https://api-docs.statebacked.dev/operation/operation-get-machines-parameter-v.md) - [Provisionally create a new machine definition version.](https://api-docs.statebacked.dev/operation/operation-post-machines-parameter-v.md) - [Finalize creation of a machine definition version.](https://api-docs.statebacked.dev/operation/operation-put-machines-parameter-v-parameter.md) [Powered by Bump.sh](https://bump.sh)