Setting the file. One moment.
Evals · Clerk Backend API · clerk/skills · Skills Docs
ContentsBack to the top of the page Raw file
evals/ evals.json
JSON · 87 lines · 5 KB
10
"expectations"
: [
11 "Uses GET /v1/users endpoint" ,
12 "Includes a created_at or date-based filter query parameter to narrow to last 7 days" ,
13 "Sets CLERK_SECRET_KEY as Bearer token in the Authorization header" ,
14 "Parses the JSON response array of user objects" ,
15 "Handles or mentions pagination via limit and offset parameters"
16 ]
17 },
18 {
19 "id" : 2 ,
20 "prompt" : "use the clerk backend api to create a new organization called 'Acme Corp' and invite user@example.com as an admin" ,
21 "expected_output" : "Two API calls: POST /v1/organizations to create org, then POST /v1/organizations/{id}/invitations to invite with admin role" ,
22 "scaffold" : "nextjs-basic-auth" ,
23 "files" : [],
24 "expectations" : [
25 "Uses POST /v1/organizations to create the organization with name 'Acme Corp'" ,
26 "Uses POST /v1/organizations/{id}/invitations to send the invitation" ,
27 "Sets the role to admin (or org:admin) in the invitation payload" ,
28 "Authenticates both API calls using CLERK_SECRET_KEY in the Authorization header" ,
29 "Extracts the organization ID from the first response and uses it in the invitation request"
30 ]
31 },
32 {
33 "id" : 3 ,
34 "prompt" : "i need to set custom metadata on a user via clerk's backend api. set their plan to 'pro' and onboarded to true" ,
35 "expected_output" : "PATCH /v1/users/{user_id} with public_metadata or private_metadata body, explanation of metadata types and when to use each" ,
36 "scaffold" : "nextjs-basic-auth" ,
37 "files" : [],
38 "expectations" : [
39 "Uses PATCH /v1/users/{user_id} endpoint" ,
40 "Sets the metadata in the correct field: public_metadata, private_metadata, or unsafe_metadata" ,
41 "Explains the difference between metadata types (client-readable vs server-only vs client-writable)" ,
42 "Includes a properly formed JSON body with the plan and onboarded fields" ,
43 "Mentions checking write permissions before executing the update"
44 ]
45 },
46 {
47 "id" : 4 ,
48 "prompt" : "remove a user with id user_abc123 from our clerk instance using the backend api" ,
49 "expected_output" : "DELETE /v1/users/{user_id} call with warning about irreversibility, CLERK_BAPI_SCOPES check, and CLERK_SECRET_KEY auth" ,
50 "scaffold" : "nextjs-basic-auth" ,
51 "files" : [],
52 "expectations" : [
53 "Uses DELETE /v1/users/{user_id} endpoint with the correct user ID" ,
54 "Warns that the action is destructive and irreversible" ,
55 "Requires or recommends explicit confirmation before executing the delete" ,
56 "Includes CLERK_SECRET_KEY as Bearer token in the Authorization header" ,
57 "Mentions implications such as loss of user data, sessions, and associated records"
58 ]
59 },
60 {
61 "id" : 5 ,
62 "prompt" : "i'm updating user metadata to add a 'plan' field but it keeps deleting the existing 'role' field. what am i doing wrong?" ,
63 "expected_output" : "Metadata updates overwrite not merge. Read existing metadata first, spread it, then write back." ,
64 "scaffold" : "nextjs-basic-auth" ,
65 "expectations" : [
66 "Explains that updateUser publicMetadata replaces all existing metadata, not merges" ,
67 "Shows reading the existing user first with getUser(userId)" ,
68 "Spreads existing metadata before adding new fields ({ ...user.publicMetadata, plan: 'pro' })" ,
69 "Calls updateUser with the merged metadata object" ,
70 "Warns that this applies to publicMetadata, privateMetadata, and unsafeMetadata equally"
71 ]
72 },
73 {
74 "id" : 6 ,
75 "prompt" : "my clerk backend api calls are failing with 429 errors in development. what are the rate limits?" ,
76 "expected_output" : "Development has 100 req/10s limit (vs 1000/10s in production). Batch operations or reduce call frequency." ,
77 "scaffold" : "nextjs-basic-auth" ,
78 "expectations" : [
79 "States the development rate limit (100 requests per 10 seconds)" ,
80 "States the production rate limit (1000 requests per 10 seconds)" ,
81 "Suggests batching operations or reducing call frequency" ,
82 "Mentions that currentUser() counts as an API call against the limit" ,
83 "Recommends using auth() instead of currentUser() when only session claims are needed"
84 ]
85 }
86 ]
87 }