Another approach with the SDK is create a JWT token with the SDK, sending it to your server and using the JWT there to Auth the user server sided
That sounds very annoying for some reason, why doesn't it work more naturally? All projects I find pretty much use anonymous login which can be done on server side, or dont use the appwrite sdk on the server side conveniently. Do you have an example of how I can implement that?
We have plans to improve how we handle SSR.
You've already found the best example for how to handle SSR.
Well that only really works for anonymous login, what can I do to login with oauth?
It doesn't works naturally because you're rendering or in other words building the interface and data server sided instead of client sided
How can I have qwik client send the cookie to qwik server? Hope you understand what I mean 🙂
Easiest way is performing that client sided, by rendering things client side
But server can't make api calls then without access to user object right?
You don't call to the appwrite instance from server
Instead, from your client (users phone)
But then what's the point of SSR?
You mean benefits?
Yes
I could say, mainly SEO
And faster load for static data
But if you're building a website or app who has dynamic data, probably nothing of both things mentioned will matter
In the opposite case, as said, you will need to perform Auth client sided and then send the JWT to the server
Fair enough, however. How does something like auth.js do this? They somehow work both client and server side natively for qwik. Maybe that can help appwrite optimize for ssr at some point
Sincerely, not sure how auth.js works, but probably the same way as if you perform authentication client sided and then you send the JWT to server side, but handling all of that automatically
Thanks for that, not sure where to go from here since my application can't scale with limitations so might go for something custom. But I will definitely use Appwrite for something more smaller. Sorry for the trouble, lastly what framework does Appwrite support best? Where almost everything works out of the box?
Scaling doesn't has anything to do with what I have meant
You can scale with appwrite independently of the method used to render the website, as said, it has nothing to do with scaling
Sorry, by scale I mean work with increase in complexity. Lesser the parts I build the better it is
I think the only more complex part will be Auth
Like logging in with email and password? Same approach applies...replace the anonymous auth API call with the create email session API call
Recommended threads
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...