I was using Appwrite trying to create a login component in Framer but I am getting an error when I use the createEmailPasswordSession method. The same code works on my Next JS application on localhost but when I try calling this method from the framer component it gives me this error:
Here's my code: import { useState } from "react" import { Client, Account } from "appwrite"
/**
- These annotations control how your component sizes
- Learn more: https://www.framer.com/developers/components/auto-sizing
- @framerSupportedLayoutWidth auto
- @framerSupportedLayoutHeight auto */
export default function Auth(props) { const [email, setEmail] = useState("krutik@framer.com") const [password, setPassword] = useState("<PASSWORD>")
const client = new Client().setProject("66be39a70024858da9ff")
const account = new Account(client)
async function handleSubmit() {
if (email === "" || password === "") {
return
}
try {
const result = await account.createEmailPasswordSession(
email,
password
)
console.log(`success: `, result)
} catch (e) {
console.log(`fail: `, e)
}
}
return (
<div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
<input
style={inputStyle}
type="email"
placeholder="krutik@framer.com"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<input
style={inputStyle}
type="password"
placeholder="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
<button onClick={handleSubmit} style={buttonStyle}>
Login
</button>
</div>
)
}
Recommended threads
- Having issues with Goggle Authentication...
My google auth is not redirecting me to my failureurl. I think it might be a session issue because it's working in my laptop but when I try it in another laptop...
- I'm getting error Invalid `url` param: I...
``` 2025-10-26T12:52:02.292Z [error] AppwriteException: Invalid `url` param: Invalid URI. Register your new client (vercel.com) as a new Web platform on your pr...
- Deployed website on Sites not opening.
Hey y'all. I deployed a site as a submission for the Sites Hackathon, which was nearly a month ago. After the hackathon, I never really opened the site. Now, wh...