birving2
birving2
CCConvex Community
Created by birving2 on 9/7/2024 in #support-community
Using clerk node sdk in convex
I have been trying to use the "deleteUser" function offered by clerks node sdk and it doesnt seem to work. Has anyone done this before that can help point me in the right direction? (It looks like a clerk error, so if anyone can review if what im doing makes sense or needs changing, that'd be nice!) Code:
import { clerkClient } from "@clerk/clerk-sdk-node";

export const deleteUser = mutation({
args: {
id: v.id("users"),
stripeAccountId: v.string(),
clerkId: v.string(),
},
handler: async (ctx, args) => {
// Works: We are correctly integrating clerk in the auth.config.js
const userId = await ctx.auth.getUserIdentity();

// Fails: The function call fails with the error down below
const clerk = await clerkClient.users.getUser(
"user_2lk90VHBD62SUWhH1eilL3NnAI7"
);

await clerkClient.users.deleteUser(args.clerkId);
await stripe.accounts.del(args.stripeAccountId);
await ctx.db.patch(args.id, { isDeleted: true });
},
});

Error:
import { clerkClient } from "@clerk/clerk-sdk-node";

export const deleteUser = mutation({
args: {
id: v.id("users"),
stripeAccountId: v.string(),
clerkId: v.string(),
},
handler: async (ctx, args) => {
// Works: We are correctly integrating clerk in the auth.config.js
const userId = await ctx.auth.getUserIdentity();

// Fails: The function call fails with the error down below
const clerk = await clerkClient.users.getUser(
"user_2lk90VHBD62SUWhH1eilL3NnAI7"
);

await clerkClient.users.deleteUser(args.clerkId);
await stripe.accounts.del(args.stripeAccountId);
await ctx.db.patch(args.id, { isDeleted: true });
},
});

Error:
1 replies
CCConvex Community
Created by birving2 on 8/19/2024 in #support-community
Dev dashboard doesnt work
No description
2 replies
CCConvex Community
Created by birving2 on 5/17/2024 in #support-community
Record<string, number> in db schema
Hey folks, i was wondering how do you create a field validation in the db schema that is the equivalent to Record<string, number>. Where the key in the object is any string?
2 replies
CCConvex Community
Created by birving2 on 11/7/2023 in #support-community
Switch Convex Accounts in CLI
No description
5 replies