
`import { Client } from 'node-appwrite';
export default async ({ req, res, log, error }) => { // Initialize Appwrite const client = new Client() .setEndpoint('api.example.com') .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) .setKey(process.env.APPWRITE_API_KEY);
// Init database const database = new client.Databases(client)`
error: TypeError: client.Databases is not a constructor at Module.default (file:///usr/local/server/src/function/src/main.js:28:20) at execute (/usr/local/server/src/server.js:141:48) at async /usr/local/server/src/server.js:158:13

Function was made with the starter template.

Databases is not a valid constructor functions
Recommended threads
- Cannot access my Appwrite database on th...
Hello guys, I am currently developing a web app and using appwrite for authentication, database, storage and messaging. It was working well but since yesterday...
- Nuxt Middleware Support
So I'm trying to protect some routes so that the user is redirected back to the login screen should they not have an active session. However, I'm stuck in a lo...
- Sites Problem
Hi, I keep getting this problem when deploying my site. I have already made sure the site is active which it is. It even shows the preview of my site but when ...
