1{2 "skill_name": "clerk-chrome-extension-patterns",3 "evals": [4 {5 "id": 1,6 "prompt": "i need to wrap my chrome extension popup in ClerkProvider from @clerk/chrome-extension. what props does it need for redirect URLs to work inside a chrome extension?",7 "expected_output": "ClerkProvider with publishableKey, redirect URLs using chrome.runtime.getURL",8 "scaffold": "chrome-ext-basic-auth",9 "expectations": [
10 "Imports ClerkProvider from @clerk/chrome-extension (not @clerk/react or @clerk/nextjs)",
11 "Passes publishableKey prop to ClerkProvider",
12 "Uses chrome.runtime.getURL for redirect URL props (afterSignOutUrl, signInFallbackRedirectUrl, or similar)",
13 "Uses SignInButton or SignUpButton for unauthenticated state",
14 "Uses UserButton or user profile component for authenticated state"
15 ]
16 },
17 {
18 "id": 2,
19 "prompt": "my background service worker needs to make authenticated API calls to my server. how can it access the current user's session token?",
20 "expected_output": "Use createClerkClient from @clerk/chrome-extension/client with background: true to get a fresh session token",
21 "scaffold": "chrome-ext-basic-auth",
22 "expectations": [
23 "Imports createClerkClient from @clerk/chrome-extension/client (not @clerk/chrome-extension)",
24 "Calls createClerkClient with background: true option",
25 "Checks clerk.session before calling getToken()",
26 "Returns true from the chrome.runtime.onMessage listener to keep connection open for async sendResponse",
27 "Explains that background: true keeps the session fresh when popup is closed"
28 ]
29 },
30 {
31 "id": 3,
32 "prompt": "my content script needs to check if the user is signed in before injecting a UI overlay into the page. how do i access clerk auth state from a content script?",
33 "expected_output": "Content script uses message passing to background service worker which uses createClerkClient to get auth state",
34 "scaffold": "chrome-ext-basic-auth",
35 "expectations": [
36 "Explains that Clerk cannot be used directly in content scripts due to origin restrictions",
37 "Uses chrome.runtime.sendMessage to request auth state from background service worker",
38 "Background script uses createClerkClient from @clerk/chrome-extension/client",
39 "Shows how to conditionally inject UI based on the response",
40 "Handles the async nature of message passing with return true in background listener"
41 ]
42 },
43 {
44 "id": 4,
45 "prompt": "my chrome extension needs to let users sign in with google oauth. how do i set that up?",
46 "expected_output": "OAuth is not supported directly in popup or side panel -- must use syncHost to delegate to a web app",
47 "scaffold": "chrome-ext-basic-auth",
48 "expectations": [
49 "States clearly that OAuth is NOT supported in the popup or side panel",
50 "Explains that OAuth requires a redirect from the Identity Provider which Chrome extensions do not support",
51 "Introduces the syncHost approach to delegate auth to a companion web app",
53 "Mentions adding syncHost prop to ClerkProvider"
54 ]
55 },
56 {
57 "id": 5,
58 "prompt": "i want my extension to automatically know when the user signs in on my web app without them having to interact with the popup. how?",
59 "expected_output": "Use syncHost prop + host_permissions + add extension ID to allowed_origins via Clerk API",
60 "scaffold": "chrome-ext-basic-auth",
61 "expectations": [
62 "Introduces the syncHost feature to sync auth state from web app to extension",
63 "Shows PLASMO_PUBLIC_CLERK_SYNC_HOST env var setup for dev and prod",
64 "Shows adding syncHost prop to ClerkProvider",
65 "Shows host_permissions configuration in package.json manifest",
66 "Shows the curl command to add extension ID to allowed_origins via Clerk API"
67 ]
68 },
69 {
70 "id": 6,
71 "prompt": "every time i rebuild my chrome extension, the extension ID changes and clerk auth breaks because the redirect URLs don't match. how do i fix this?",
72 "expected_output": "Pin the extension ID by providing a consistent key in the manifest, then update Clerk Dashboard with the stable chrome-extension:// URL",
73 "scaffold": "chrome-ext-basic-auth",
74 "expectations": [
75 "Explains that the extension ID changes because Chrome derives it from the key field",
76 "Shows how to pin the extension ID by providing a consistent key via .env.chrome and package.json",
77 "Mentions the CRX_PUBLIC_KEY env var and manifest key field",
78 "Mentions updating the Clerk Dashboard or allowed_origins with the stable chrome-extension:// URL",
79 "Notes that Plasmo Itero can generate the keypair"