Quickstart: Vue
#
OverviewThis is a brief example of how to integrate Architect SDK
into your Vue application. For more comprehensive guide you can check our phonebook app tutorial.
#
Install Architect SDKInstall Architect SDK via:
- npm
- Yarn
You should see architect-sdk
dependency added to package.json file1.
#
Setup environmentFirst in your .env
file add following line:
Then create new file architectSDKConfig.ts
. Then add following imports.
Then import VITE_BASE_URL
from .env
.
Next we will define special type to make full use of Architect SDK
1. We need to define special type ArchitectResource
and pass it to Architect SDK
configuration. This will enable you to get full autocomplete and other benefits of strongly typed package. Let's say that you are making todo app and you have Todo
type with following properties:
Then you should define type ArchitectSchema
like this:
Finally we should initialize Architect SDK
by passing to him baseUrl
and ArchitectSchema
like this:
You can now use architectSDK
to update
, create
, delete
, get
you todos.
- You can skip this step if you are not using typescript.โฉ