Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

Using next-auth on my Vercel website. Google thinks the Auth routes are phishing

I've attached [auth].ts in my code. It is the boilerplate with the exception of my providers and a firestore adapter. Google thinks every single one of my auth endpoints is compromised. Is firestore the reason why Google thinks the auth is phishing? Is there something I need to do with t3?

Hosting t3 with websockets

Is there a simple hosting solution for running t3 app with websockets? Vercel doesn't support websockets, if I understand the docs correctly....

Clerk Self-Delivered - question

Does anyone have any recommendations for best ways to provide Self-Delivered emails from Clerk? i.e. Going from receiving the webhook to sending the email. (My initial thoughts are using a lambda and AWS SES but wondered if there was any others that might be better suited)...

Next/Vercel vs. Website Builders

Possibly a long rehashed question, and I know this might not be the best channel -- I'm trying to figure out my own style as a web dev, and currently building a portfolio with lots of pro bono work, mostly for NGO's in West Africa. With limited operational costs, I always feel conflicted choosing between a website builder and hosting on vercel. The majority the work is simple navigation, which could be accomplished with SSR. Very little javascript. No auth, no login, no DB, etc. Can someone help me walk through the pros and cons? Vercel Pros: ...

augmentation next auth

Hi, i tried to override User type from next auth with TS module augmentation but seems not working.
I should not be able to see default User properties that come from NextAuth such as image and name since I overrode...

Adding prisma after init

I've already inited a t3 app but I want to add the prisma add-on on top. How can I ?

Make this typesafe pls

```js const FeaturesMobile: React.FC = () => { let [activeIndex, setActiveIndex] = useState(0); let slideContainerRef = useRef<any>(null); let slideRefs = useRef<any>([]);...

Next 13 App Router Realtime - Am I missing something?

I want to have some kind of real time behavior for my app. I've decided that SWR (https://swr.vercel.app/) is the right way to go for me, just for simplicity sake. Imagine I use the Next 13 App Router, make database called in my server components, then render the client components with that data. In this case if I wanted to implements SWR then for that data then I would still have to define a tRPC route to fetch that same data in order to wrap it in the SWR component. So basically that client component would receive the data from its parent server component but then would have to also call the tRPC + SWR for the same data. The same would be true for any real time layer you would implement in the client component....

Two providers one user

Is there a way of having two providers (discord and steam) in next auth link up to the same user?
Solution:
got it just had to add allowDangerousEmailAccountLinking: true, to the provider options

Ideal UI behaviour for tables on mobile

What is the recommended behavior for tables on a mobile UI?

Want all records to be deleted given a specified datetime

Basically, I want to be able to delete a record, which contains a datetime value called lets say deleteAt, at the time deleteAt specifies. For example, if a user creates a post, and assigns 4/15/23 12:00 AM as the deleteAt value, how can I delete it at that time, given that I'm using the t3 stack?

tRPC but just the React Query abstraction?

I'm integrating with an existing Python backend, but I really like the way tRPC procedures are defined and used (with react query in particular). I could make fetch calls from the NextJS backend to the python backend, because the backends are on the same machine, but I would still prefer to have the browser show the direct API call instead of trying to debug in two separate interfaces. Not sure if that makes sense, but I'm happy to elaborate more if there are any questions 🙂...

websocket (ws package) client connection keeps restarting on ct3a project.

The ws server and next server starts fine, but when I connect with a client it keeps restarting .... this is the utils/app.ts file. Need help figuring out how to fix it. the rest of the code is here: https://github.com/imoxto/inent_v0/tree/ws-server ``ts const getBaseUrl = () => { if (typeof window !== "undefined") return ""; // browser should use relative url if (process.env.VERCEL_URL) return https://${process.env.VERCEL_URL}`; // SSR should use vercel url...

how to extend clerk's users metadata

Im wondering how to extend clerk users model by adding some data about the user's role. I know it can be done but I don't know how I can do it in a way to check once the user sign in it check if the user's email is in a table with a role and add it its correspondent role. Clerk's docs has an example of adding metadata but the example is unclear for me ...

Incomprehensible build failures

Howdy yall, pretty new to vercel / t3 stack here. I am getting a build failure on my new t3 app that I can't make heads or tails of. The build output is as attached. Has anyone seen anything like this before? Do you have any suggestions for unblocking this build failure?...

Create a User model in Prisma with Clerk on Signup

One of the benefits I find with NextAuth is that it simplifies a lot by adding a User model to Prisma, so that I have each user in my database right at the start. I'm having some difficulties in finding some documentation to implement this with Clerk. I guess that I need to create some kind of mutation right when the user signs up. But in that case I would need the data (atleast userId) right when the user creates their account (I am using Discord Provider). Anyone know of some kind of solution to implement this? Do I perhaps need to create some custom authentication with Clerk?...

devalue vs superjson

I can see that in TRPC documentation, superjson is mostly suggested as the transformer. I recently found out about devalue and this comparison: https://github.com/Rich-Harris/superjson-and-devalue. It seems there was a security issue with devalue. As far as I know, the issue appears to have been fixed. So, are there any reasons to use superjson instead of devalue now?...

trpc routerOutputs

is there a way to get medicalRecord as a single item? thanks
Solution:
i guess you could do like NonNullable<RouterOutputs['whatever']>['number']

Best Way to Handle Rich Text Input in a NextJS app?

I'm a developer working on an app connecting university/college graduates with job opportunities at startups, and as such the startups need to be able to input rich text for their "company page" and each individual job post - ensuring they're formatted properly and not just huge blocks of text. What I'm essentially after is a rudimentary version of Medium's blogging inputs. I'm currently testing it with React Slate, but has anyone used anything else that they'd recommend, or another approach entirely? Thanks 🙏...

Turborepo and importing packages

I'm trying to get started with monorepos and am using turborepo in the toolchain. I have a git repository that contains some Next pages/api/components which I want to use in my main application (the one in the monorepo). Somehow I'm expecting to specify my git repo somewhat and then the code to by pulled into the monorepo. This would allow me to maintain common elements used in lots of applications (each in thier own monorepo) and have these included in the main app build. My question here is wh...