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

SEO best practices in t3

Hi, I am new to the t3 stack, coming from remix.run (which was a big letdown). I want to create an e-commerce app using SSR technologies with a decent + SEO. As far as I can tell and from the examples I see, the data is fetched on the client using react-query. Can some one refer my to a blogpost or a github project or video, any material out there on the subject? thanks!...

Issue with useMutation() when trying to test React component

Hi, I am having issues with my test failing since it cannot render the component properly because of this error: ``` TypeError: Cannot destructure property 'client' of 'useContext(...)' as it is null. ❯ Object.useMutation$1 [as useMutation] node_modules/@trpc/react-query/dist/createHooksInternal-416876ed.mjs:372:17 ❯ node_modules/@trpc/react-query/dist/createHooksInternal-416876ed.mjs:50:34...

Creating APIs with Bearer Auth in API Gateway

Hey all, I'm just looking for some resources on setting up bearer authorization in AWS. At the moment I have API Key auth implemented, but would prefer a system where they hit /token with their API key and use the returned JWT bearer token for subsequent requests with auto refresh and all of that nice stuff. Most of the resources I've found online have been tough to digest, so I thought I'd see if anyone has experience doing this or knows of a good resource to learn about it. Thank you!

using prisma accelerate in t3

im abit new to ts, so how do i tackle this error, thanks in advance

Using Upstash

Hey guys, I was wondering if i could get some insight into the best way to design the following system. I have a rough idea on how to design it but not 100% sure. So I have IoT devices in the field, and only activate when a certain sensor is enabled (which should send a notification to the user with the data)....

Vercel: Private Past Production Deployments

Hope you liked all of the alliteration in the title. Anyways, I was wondering if there is a way to prevent previous versions of production deployments from being publicly accessible. I'm aware that this is possible for preview deployments, but I wasn't able to find a way to do this for production deployments. I see that there is an option to "Also protect my Production Deployment" (see screenshot), but the wording implies that this is for all production deployments, rather than just previous o...

How to add admonitions/call-outs and code block file names to an Astro site?

What plugins would I need to add to an Astro project use to get these cool call-out sections (triple quotes in Markdown) and the code snippet file name? Attached are some pictures of the Astro docs site and Markdown source as a reference. I tried going through the withastro/docs Astro config but couldn't make out what plugins they were using for this. 🤔

Next 13 + NextAuth - Redirect on the server

So... I was wondering if anyone has this figured out. I want a protected dashboard page that gets the session and redirects if not authed. Buttt... I wanted this on a server component. Instead of rendering the page then redirecting if session is null. ...

refetch useSession data

hi, I have a settings page where I let users change their username. Happens so that that exact username is in the NavBar and needs to be updated. In the navbar I'm using useSession to get the users username. How do I refetch this? I googled around for a bit and running getSession({ triggerEvent: true, broadcast: true }) after mutating the username works to some extend, just not on the same window? It updates the username in other windows though, but not the window where that code is ran....

use github for oauth not as my personal profile

i'm working on an app where github is the authentication measure. currently i have it working, but i feel like when signing up, people might be hesitant to login when oauth prompts the user with allow <my name> to do x y and z with your account, or whatever the message is. i'm just wondering how people generally do this- new github account? or is there a way around this? (this question also sort of applies for other oauth providers as im planning on adding more than just github, eventually probably even revoking github)...

WebSocket workflow for serverless with T3 stack

I'm just starting with WebSockets, and would like to get confirmation if I'm on the right track regarding how the communication between services is made. The basic pitch for the part of the project I want to discuss is the following: 2 users send information to the server. The information is only processed when both of them deliver their data, and then is sent back via a WebSocket subscription for both of them. Also, in order to process this new information to send to them, I need not only the data sent from both the users, but the previous processed information as well (this, I believe, means I'll need to store this processed information somewhere that is quickly retrievable so I can get it back in the next round of requests). The workflow I had in mind is like this: - User 1 makes a POST request for Next.js with the desired data - Next.js gets Redis' data to confirm if User 1 is the last to post in this round...

next-auth add sign in using github button to page instead of redirect

Hey, just like in the title, I want to add sign in button in the home page instead of default redirect page is it possible to do? Or is it just how next-auth works? Sorry if it is a stupid question but I couldn't find an answer to that.

session does not exist in SSR using with createProxySSGHelpers

Hello, I'm following TRPC docs and I want to fetch user decks in getServerSideProps using createProxySSGHelpers, but I'm getting 'UNAUTHORIZED' error am I missing something? it should be returned from createContextInner right? ```typescript...

How to fix "Invalid environment variables"

Error: Invalid environment variables

When to use next-auth

If I only plan on only using credentials i.e not using providers like discord, github, etc. Is it worth using next-auth or am I better of making my own custom authentication?

Sending additional info in the magic link auth token

Is it possible to pass additional data to the token that is sent for authentication via email magic links and when the email button is pressed and the signIn callback is called to also be able to process that token and that additional information that has been sent? And also for Google Oauth? #note: I am using database sessions...

Change image on hover in react project with tailwindcss

Hi, I am doing a project with react and tailwindcss, and I am having some problems: 1 - I need to change a image inside a button when I hover the button, but I dont have any idea on how to do it. 2 - I need to make a button than onClick it opens a little menu with 3 other buttons, and I dont know how to do it with Tailwind too. If someone have any ideia it would be very helpfull for me, thanks....

Any resources to learn the tRPC better? Hopefully with guides and examples?

Really struggling to learn otherwise in context of ct3 stack