Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions conversions/leads/clerk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,20 @@ Here's a quick summary of the steps:
dubClickId: dubId || "n/a",
},
});

/**
If have existing public metadata in your clerk user you will want to merge the existing metadata with the new metadata.
This is to avoid losing any existing metadata.

const usermetadata = await clerk.users.getUser(id);

await clerk.users.updateUser(id, {
publicMetadata: {
...usermetadata.publicMetadata,
dubClickId: dubId || 'n/a',
});
*/

const res = NextResponse.json({ ok: true });
// Delete the dub_id cookie
res.cookies.set("dub_id", "", {
Expand Down