CodeWithAntonio
CodeWithAntonio
Explore posts from servers
CCConvex Community
Created by sol on 4/16/2024 in #support-community
Preparing Convex Functions
Hi @ballingt my apologies for the ping - a student of mine on Windows faces the exact same problem, 2 prints of preparing functions, and then shuts down w/o errors. We tried debugging via --verbose but no luck. Same if we remove the .env variables and attempt a creation of new project. He is on node 20. Is there anything you would recommend they attempt to do? 🙏 I have no issues with this on MacOS, node 20 as well
48 replies
DTDrizzle Team
Created by CodeWithAntonio on 2/20/2024 in #help
Studio loading forever
Looks like it was just cache! false alarm, my apologies 🙂
2 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
I geniunely thought we had to do it using clerk/react only haha
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
thanks so much, will make my life easier haha
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
ooooh thats great!!!
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
(ConvexProviderWithClerk)
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
I am mostly interesetd in how step 8 would look like with using the other way ? https://docs.convex.dev/auth/clerk
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
oooh I thought that we are required to use clerk/react only, and not allowed to use the nextjs clerk package? Nextjs package is how I usually use clerk in my tutorials. If I can do it using the nextjs package, that can simplify things a lot!
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
Thanks @Michal Srb! LiveBlocks team gave me this solution for now:
const { getToken } = useAuth();
const [ready, setReady] = useState(false);

useEffect(() => {
async function run() {
const token = await getToken({ template: "convex" });
sessionStorage.setItem("jwt", token!);
setReady(true);
}

run();
}, [getToken])
const { getToken } = useAuth();
const [ready, setReady] = useState(false);

useEffect(() => {
async function run() {
const token = await getToken({ template: "convex" });
sessionStorage.setItem("jwt", token!);
setReady(true);
}

run();
}, [getToken])
This way I can access it in their config file. Thanks for all the help!
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
Maybe we can resolve this in another way too: Is it possible to use @clerk/nextjs and middleware.ts with Convex?
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
I will contact them as well if they know a solution
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
They do allow replacing the authEndpoint to be a callback instead, where I can have more options, but using hooks like useAuth is not one of them :/
import { createClient } from "@liveblocks/client";

const client = createClient({
authEndpoint: async (room) => {
const response = await fetch("/api/liveblocks-auth", {
method: "POST",
headers: {
Authentication: "<your own headers here>",
"Content-Type": "application/json",
},
body: JSON.stringify({ room }), // Don't forget to pass `room` down
});
return await response.json();
},
});
import { createClient } from "@liveblocks/client";

const client = createClient({
authEndpoint: async (room) => {
const response = await fetch("/api/liveblocks-auth", {
method: "POST",
headers: {
Authentication: "<your own headers here>",
"Content-Type": "application/json",
},
body: JSON.stringify({ room }), // Don't forget to pass `room` down
});
return await response.json();
},
});
21 replies
CCConvex Community
Created by CodeWithAntonio on 1/13/2024 in #support-community
Clerk Auth in Route Handlers
Thank you for that info, I understand how I have to approach it now, the issue is the I don't exactly control the fetch method which the third-party library fires to my route handler endpoint 😅
21 replies
CCConvex Community
Created by CodeWithAntonio on 10/12/2023 in #show-and-tell
Notion Clone
Thank you!
14 replies
CCConvex Community
Created by CodeWithAntonio on 10/12/2023 in #show-and-tell
Notion Clone
I found BlockNote to be a perfect abstraction around TipTap. Using TipTap itself would definitely be the best option, but it would take me at least 8 more hours to come up with something even remotely close to BlockNote. So its a great package for a notion like editor which allows massive customization. There is also Novel, which i am not sure if it is built to be imported into other projects and will be maintaned or if its just a demo of what can be built with tiptap, so I skipped it even thought it looks amazing. There is also Editor.JS which is great but it is intended to be used as a content management system meaning that you would save code blocks representing the content and then render them and style them differently by using the ID / Type of the blocks, so its not exactly a wysiwyg but its amazing
14 replies
CCConvex Community
Created by CodeWithAntonio on 10/12/2023 in #show-and-tell
Notion Clone
on my original code and deployment i got it right on the first try just by reading the docs 🙂
14 replies
CCConvex Community
Created by CodeWithAntonio on 10/12/2023 in #show-and-tell
Notion Clone
yes! i got a little confused there but I would not blame it on the docs, its just that while talking about what I am doing, doing it, recording it, being close to finishing the video makes me a bit unfocused 😅
14 replies