wen i am trying to wrap the services on a provider it showing error why ???
import { Client, Databases, Account,ID} from "appwrite";
import conf from "../conf/conf";
export class Services{
client = new Client()
account
databases
constructor(){
this.client.setEndpoint(conf.Appwrite_url)
.setProject(conf.APPWRITE_PROJECT_ID)
this.account=new Account(this.client)
this.databases=new Account(this.client)
}
async register(email, password){
try {
await this.account.create(email,password)
await this.login(email,password)
} catch (error) {
console.log('there is some error in login')
return false
}
}
async login(email,password){
try {
await this.account.createEmailSession(email,password)
} catch (error) {
console.log('there is some error in login')
return false
}
}
async logout(){
try {
await this.account.deleteSessions('current')
} catch (error) {
console.log('there is some error in logout')
}
}
}
const services=new Services()
export default services here is my service file
FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.
Recommended threads
- Cant get realtime working
Hey I nned some help with realtime a gain. I was using client.subscribe(...), and i found out that its depricated then i believe realtime.subscribe(...) is the ...
- Hi Folks, Database Writing Issue
Hey Folks im trying to get logging setup on my website but im getting an error, i dont have any document id and i think this is the issue but i havent got the f...
- Middleware
how to make middleware in nextjs appwrite with client side auth?