CodeWithAntonio
CodeWithAntonio
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
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 9/30/2023 in #support-community
Authorized queries & mutations (patch, delete, get)
Awesome! Checking it out now, thank you!
6 replies
CCConvex Community
Created by CodeWithAntonio on 9/30/2023 in #support-community
Recursive query performance
No description
23 replies
CCConvex Community
Created by CodeWithAntonio on 9/30/2023 in #support-community
Recursive query performance
Thanks a lot for the input! I've been playing around with getAll and then used a Map on the frontend to create the structure I expect, and it definitely "feels" faster on the frontend since everything is loaded upfront, just not sure if I am actually saving any bandwidth there 🙂 Nevertheless very interesting to play around with this
23 replies
CCConvex Community
Created by CodeWithAntonio on 9/30/2023 in #support-community
Recursive query performance
Got it, thank you a lot for answering!
23 replies
CCConvex Community
Created by CodeWithAntonio on 9/30/2023 in #support-community
Recursive query performance
seems to work fine
23 replies
CCConvex Community
Created by CodeWithAntonio on 9/30/2023 in #support-community
Recursive query performance
btw, I also send "undefined" as args.parentDocument for the upmost documents (parents)
23 replies
CCConvex Community
Created by CodeWithAntonio on 9/30/2023 in #support-community
Recursive query performance
would this improve performance?
23 replies
CCConvex Community
Created by CodeWithAntonio on 9/30/2023 in #support-community
Recursive query performance
No description
23 replies