Back

appWriteConfig.js:11 Uncaught TypeError: account.createPhoneSession is not a function at appWrite

  • 1
  • Auth
  • Web
  • Cloud
Tejas nasre
17 Apr, 2024, 16:44

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.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more