<@710556005150359665> this sounds interesting! Wil...
# share-your-work
r
@robschilder this sounds interesting! Will investigate it today / tomorrow! Thanks.
r
Okay at least we have an answer that they definitely won't add Supertokens themselves!
r
Yeaaa.. not sure if they will want to merge a PR that adds ST for them either.
r
Alright.. and what about just an tRPC example from Supertokens itself? If you look at this other starter: https://github.com/t3-oss/create-t3-turbo, they're using Next-Auth to only authenticate for the Next.js app, not Expo, because they don't have a good example out there. If there won't be a Supertokens example, I think all future startups using this popular setup (or similar cross platform setup) will use Clerk because it's "officially" supporting such a stack. Meanwhile, Supertokens is more capable than Clerk but doesn't have the tech influencers promoting the solution meaning people don't know. Supertokens is incredible powerful for cross-platform apps because it has the header-based auth, it's multi-tenant, has account linking, has all social auth providers, etc.. It will work incredible well with multi-project schemas from Drizzle https://orm.drizzle.team/docs/goodies#multi-project-schema meaning one could have 1 auth backend, 1 database, for many different projects, as far as I understand. Showcasing this through the create-t3-turbo app would show many people the power of Supertokens I guess.
r
Yeaaaa. That’s true. We need to figure out a way to get them to be more open minded. But based on the comments, I’m not sure they will even add clerk to it.
u
Hey all, maintainer of t4-app checking in. Would Supertokens be intereted in a collab? We are moving away from Supabase to solve a big pain point for new users setting up the stack. My understanding is that Supertokens is further along, plus it has 2FA support. What do you think? https://github.com/timothymiller/t4-app
r
hey @.timothymiller sure! Would love to!
How can we help?
u
Links to reference implementations for React/Next & React Native would help. Of course, any PRs to add Supertokens support into the repo would be approved.
r
Integration with nextjs: https://supertokens.com/docs/thirdpartyemailpassword/nextjs/about Integration with react native is here: https://supertokens.com/docs/thirdpartyemailpassword/custom-ui/init/frontend Would love to contrubute the PR. Will check out the repo and existing auth in the coming days. But feel free to start and we can add onto it.
> Supabase to solve a big pain point for new users setting up the stack What is this pain point btw?
u
Creating a new supabase account per project to stay within the free tier, otherwise $25/month.
r
ahh right. Okay
let me expkore your repo!
btw @robschilder , thanks for the recommendation and bringing along @.timothymiller here 🙂
@nkshah2 will be helping here as well.
@.timothymiller @robschilder one thing with supertokens is that the session management for web and react native use different SDKs, cause: - storage layers in web and RN are different - the semantics of refreshing are different: In web, we have to acquire a lock across tabs when doing a refresh which is not the case for RN How do you think this can be tackled here? Will it be possible to use different SDKs for different runtime dynamically? Or do we need to think of another solution?
I also see that there are different folders for expo and next - i thought the code would be unified? But it doesn't seem so. Am i missing something?
r
Well for having different folders we have the same situation when we are using Capacitor. @nkshah2 knows all about this. But in the scenario of Capacitor we are not using a different SDK because it's both React. So basically they share the 'screens' which are created with Tamagui. So it's unified in that sense, just different folders
r
hmm. I see.
r
(also just a side note, I saw you shared the
app-dir
link, but they're still using pages router! 🙂 )
r
ah oops.
r
I think a lot of code can be re-used from the Capacitor-Supertokens example. So that's going to easy. On the web side, the new thing here will be the integration with tRPC
And these are good questions. I don't have an intelligent answer to them.
r
> On the web side, the new thing here will be the integration with tRPC Thats not such a big issue as long as the calls to the supertokens API are via http. Applcation APIs can us tRPC.
One idea for the different session management is to use supertokens-website for both (web and RN), and if it's RN, provider overrides for the windowHandler and cookieHandler to work with RN storage, and also provide an override for the lock to work with in memory lock. This may work
r
we are using a different
cookieHandler
with Capacitor indeed too, and there we also use their native storage solution (
capacitor-preferences
)
r
yea. So something similar
r
Solito may provide some inspiration here, as it basically provides a single React Native Web (RNW, like Tamagui also uses) component that switches internally based on the platform it’s running on: https://github.com/nandorojo/solito
n
Hey @.timothymiller So ive spent some time experimenting with Expo and turns out you should be able to use the supertokens-website (have not tested with web-js) SDK on both the native expo side and on the web with expo. Im not too familiar with the t4 setup so if you can give me a quick summary of it that would be great but if your setup is similar to the capacitor project that @robschilder has then you should be able to use the website SDK on both the web and mobile. The downside is that you have to build your own UI ofcourse but you would need to do that for React Native anyway.
Let me know if you run into issues and I can help you guys with specifics
r
@.timothymiller we should be able to figure out the integration by next week, and will make a PR for it!
r
Hey guys how is this going? I could help out with this if you need help. Maybe improving some UI with Tamagui or testing out recipes on devices
r
Hey! We have a draft PR ready: https://github.com/timothymiller/t4-app/pull/106. There are still a lot of comments i have added based on my review, so wait for them to be solved (should happen sometime next week)
r
Going to try out the Supertokens branch now. Would you say it's ready?
r
Yup. It is.
r
Amazing!
2 Views