Skip to content

Commit

Permalink
Update code example for deleting a user (#1548)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisintech authored Sep 18, 2024
1 parent 1955a9e commit 0fddb15
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/users/deleting-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ To delete users using the Clerk API, you can use the [`deleteUser()`](/docs/refe
<Tabs type="framework" items={["Next.js", "Node", "cURL"]}>
<Tab>
```ts {{ filename: 'app/api/delete-user/route.ts' }}
import { auth, clerkClient } from '@clerk/nextjs/server'
import { clerkClient } from '@clerk/nextjs/server'
import { NextResponse } from 'next/server'

export async function DELETE() {
const { userId } = auth()
const userId = 'user_123'

try {
await clerkClient.users.deleteUser(userId)
await clerkClient().users.deleteUser(userId)
return NextResponse.json({ message: 'User deleted' })
} catch (error) {
console.log(error)
Expand Down Expand Up @@ -56,8 +56,8 @@ To delete users using the Clerk API, you can use the [`deleteUser()`](/docs/refe
</Tab>

<Tab>
```bash {{ filename: 'curl.sh' }}
curl -XDELETE -H 'Authorization: CLERK_SECRET_KEY' 'https://api.clerk.com/v1/users/{user_id}'
```bash {{ filename: 'terminal' }}
curl 'https://api.clerk.com/v1/users/{user_id}' -X DELETE -H 'Authorization:Bearer {{secret}}' -H 'Content-Type:application/json'
```
</Tab>
</Tabs>

0 comments on commit 0fddb15

Please sign in to comment.