saricdenOriginal post
Rank 2: Process
Is it possible to automate or provide a template to setup a new Appwrite cloud database for a user?
Things I would need to automate or template include:
- Creating a DB
- Creating collections with specific attributes in that DB
Thanks! 🙂
Summary
Yes, there is a way to automate setting up an Appwrite cloud database. You can use the database Server SDK and create a migration script. Here is an example in JavaScript:
1. Initialize the SDK and client:
```js
const sdk = require('node-appwrite');
const client = new sdk.Client();
const databases = new sdk.Databases(client);
```
2. Set the endpoint, project ID, and API key:
```js
client
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('5df5acd0d48c2')
.setKey('919c