My Code : import { Client, Account, ID } from "appwrite";
const client = new Client();
client
.setEndpoint(import.meta.env.VITE_APPWRITE_ENDPOINT)
.setProject(import.meta.env.VITE_APPWRITE_PROJECT_ID);
export const account = new Account(client);
const sessionToken = await account.createPhoneSession(
ID.unique(),
"+12065550100"
);
export const userId = sessionToken.userId;
export default client;
TL;DR
Error message indicates that account.createPhoneSession is not a function, which is causing an issue in the code. The solution is to double-check the appWrite configuration and ensure that account.createPhoneSession is defined properly in the account module.