# Getting Started
## Prerequisites
- [Node.js v12+](https://nodejs.org/)
- [Vue 3](https://vuejs.org/)
- [Yarn v1 classic](https://classic.yarnpkg.com/en/) (Optional)
## Installation
```bash:no-line-numbers
yarn add @braks/vue-flow
```
```bash:no-line-numbers
npm i --save @braks/vue-flow
```
## Usage
A flow consists of [nodes](https://types.vueflow.dev/interfaces/Node.html)
and (optionally) [edges](https://types.vueflow.dev/interfaces/Edge.html).
Together we call them
[elements](https://types.vueflow.dev/modules.html#Elements).
Each element needs a unique id.
A node also needs a [xy-position](https://types.vueflow.dev/interfaces/XYPosition.html). An edge needs at least a
source (node id) and a target (node id).
```vue:no-line-numbers
```
## Quickstart
The recommended method of using Vue Flow is the composition API as it allows for full control of the state, thanks to
composables and the power of [provide/inject](https://vuejs.org/guide/components/provide-inject.html). You can even
access the state outside the context and manipulate it to your liking. However, using the options API is possible,
though more limited it will probably satisfy most of your needs if you are not looking for too advanced handling of
states.
A basic setup would look like this:
@[code vue:no-line-numbers](../../../examples/src/Basic/Basic.vue)
@[code vue:no-line-numbers](../../../examples/src/Basic/BasicOptionsAPI.vue)
## TypeScript
Vue Flow is fully written in [TypeScript](https://www.typescriptlang.org/), so it is highly recommended to use TypeScript to have the best possible DX and
avoid common mistakes.
The types are included in the library.
[You can find the TypeDocs here](https://types.vueflow.dev/).