@clerk/testing 2.0.0-snapshot.v07d9254 → 2.0.0-snapshot.v20251203203405

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +11 -41
  2. package/cypress/package.json +5 -0
  3. package/dist/chunk-JDNEQWYI.mjs +10 -0
  4. package/dist/chunk-JDNEQWYI.mjs.map +1 -0
  5. package/dist/chunk-M5YIJ3SE.mjs +2 -0
  6. package/dist/chunk-M5YIJ3SE.mjs.map +1 -0
  7. package/dist/chunk-YFUXUEZ5.mjs +2 -0
  8. package/dist/chunk-YFUXUEZ5.mjs.map +1 -0
  9. package/dist/cypress/index.js +10 -0
  10. package/dist/cypress/index.js.map +1 -0
  11. package/dist/cypress/index.mjs +2 -0
  12. package/dist/cypress/index.mjs.map +1 -0
  13. package/dist/index.js +5 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +6 -0
  16. package/dist/index.mjs.map +1 -0
  17. package/dist/playwright/index.js +10 -0
  18. package/dist/playwright/index.js.map +1 -0
  19. package/dist/playwright/index.mjs +2 -0
  20. package/dist/playwright/index.mjs.map +1 -0
  21. package/dist/playwright/unstable/index.js +2 -0
  22. package/dist/playwright/unstable/index.js.map +1 -0
  23. package/dist/playwright/unstable/index.mjs +2 -0
  24. package/dist/playwright/unstable/index.mjs.map +1 -0
  25. package/dist/types/common/constants.d.ts +2 -0
  26. package/dist/types/common/constants.d.ts.map +1 -0
  27. package/dist/types/common/errors.d.ts +2 -0
  28. package/dist/types/common/errors.d.ts.map +1 -0
  29. package/dist/types/common/helpers-utils.d.ts +3 -0
  30. package/dist/types/common/helpers-utils.d.ts.map +1 -0
  31. package/dist/types/common/index.d.ts +6 -0
  32. package/dist/types/common/index.d.ts.map +1 -0
  33. package/dist/types/common/setup.d.ts +3 -0
  34. package/dist/types/common/setup.d.ts.map +1 -0
  35. package/dist/types/common/types.d.ts +30 -0
  36. package/dist/types/common/types.d.ts.map +1 -0
  37. package/dist/types/cypress/custom-commands.d.ts +60 -0
  38. package/dist/types/cypress/custom-commands.d.ts.map +1 -0
  39. package/dist/types/cypress/index.d.ts +4 -0
  40. package/dist/types/cypress/index.d.ts.map +1 -0
  41. package/dist/types/cypress/setup.d.ts +23 -0
  42. package/dist/types/cypress/setup.d.ts.map +1 -0
  43. package/dist/types/cypress/setupClerkTestingToken.d.ts +22 -0
  44. package/dist/types/cypress/setupClerkTestingToken.d.ts.map +1 -0
  45. package/dist/types/index.d.ts +1 -2
  46. package/dist/types/index.d.ts.map +1 -1
  47. package/dist/types/playwright/helpers.d.ts +101 -0
  48. package/dist/types/playwright/helpers.d.ts.map +1 -0
  49. package/dist/types/playwright/index.d.ts +4 -0
  50. package/dist/types/playwright/index.d.ts.map +1 -0
  51. package/dist/types/{setup.d.ts → playwright/setup.d.ts} +2 -7
  52. package/dist/types/playwright/setup.d.ts.map +1 -0
  53. package/dist/types/playwright/setupClerkTestingToken.d.ts +28 -0
  54. package/dist/types/playwright/setupClerkTestingToken.d.ts.map +1 -0
  55. package/dist/types/playwright/unstable/index.d.ts +5 -0
  56. package/dist/types/playwright/unstable/index.d.ts.map +1 -0
  57. package/dist/types/playwright/unstable/page-objects/apiKeys.d.ts +52 -0
  58. package/dist/types/playwright/unstable/page-objects/apiKeys.d.ts.map +1 -0
  59. package/dist/types/playwright/unstable/page-objects/app.d.ts +28 -0
  60. package/dist/types/playwright/unstable/page-objects/app.d.ts.map +1 -0
  61. package/dist/types/playwright/unstable/page-objects/checkout.d.ts +56 -0
  62. package/dist/types/playwright/unstable/page-objects/checkout.d.ts.map +1 -0
  63. package/dist/types/playwright/unstable/page-objects/clerk.d.ts +12 -0
  64. package/dist/types/playwright/unstable/page-objects/clerk.d.ts.map +1 -0
  65. package/dist/types/playwright/unstable/page-objects/common.d.ts +29 -0
  66. package/dist/types/playwright/unstable/page-objects/common.d.ts.map +1 -0
  67. package/dist/types/playwright/unstable/page-objects/expect.d.ts +14 -0
  68. package/dist/types/playwright/unstable/page-objects/expect.d.ts.map +1 -0
  69. package/dist/types/playwright/unstable/page-objects/impersonation.d.ts +8 -0
  70. package/dist/types/playwright/unstable/page-objects/impersonation.d.ts.map +1 -0
  71. package/dist/types/playwright/unstable/page-objects/index.d.ts +626 -0
  72. package/dist/types/playwright/unstable/page-objects/index.d.ts.map +1 -0
  73. package/dist/types/playwright/unstable/page-objects/keylessPopover.d.ts +13 -0
  74. package/dist/types/playwright/unstable/page-objects/keylessPopover.d.ts.map +1 -0
  75. package/dist/types/playwright/unstable/page-objects/organizationSwitcher.d.ts +43 -0
  76. package/dist/types/playwright/unstable/page-objects/organizationSwitcher.d.ts.map +1 -0
  77. package/dist/types/playwright/unstable/page-objects/planDetails.d.ts +39 -0
  78. package/dist/types/playwright/unstable/page-objects/planDetails.d.ts.map +1 -0
  79. package/dist/types/playwright/unstable/page-objects/pricingTable.d.ts +55 -0
  80. package/dist/types/playwright/unstable/page-objects/pricingTable.d.ts.map +1 -0
  81. package/dist/types/playwright/unstable/page-objects/sessionTask.d.ts +45 -0
  82. package/dist/types/playwright/unstable/page-objects/sessionTask.d.ts.map +1 -0
  83. package/dist/types/playwright/unstable/page-objects/signIn.d.ts +61 -0
  84. package/dist/types/playwright/unstable/page-objects/signIn.d.ts.map +1 -0
  85. package/dist/types/playwright/unstable/page-objects/signUp.d.ts +57 -0
  86. package/dist/types/playwright/unstable/page-objects/signUp.d.ts.map +1 -0
  87. package/dist/types/playwright/unstable/page-objects/subscriptionDetails.d.ts +41 -0
  88. package/dist/types/playwright/unstable/page-objects/subscriptionDetails.d.ts.map +1 -0
  89. package/dist/types/playwright/unstable/page-objects/testingToken.d.ts +7 -0
  90. package/dist/types/playwright/unstable/page-objects/testingToken.d.ts.map +1 -0
  91. package/dist/types/playwright/unstable/page-objects/userAvatar.d.ts +11 -0
  92. package/dist/types/playwright/unstable/page-objects/userAvatar.d.ts.map +1 -0
  93. package/dist/types/playwright/unstable/page-objects/userButton.d.ts +14 -0
  94. package/dist/types/playwright/unstable/page-objects/userButton.d.ts.map +1 -0
  95. package/dist/types/playwright/unstable/page-objects/userProfile.d.ts +60 -0
  96. package/dist/types/playwright/unstable/page-objects/userProfile.d.ts.map +1 -0
  97. package/dist/types/playwright/unstable/page-objects/userVerification.d.ts +43 -0
  98. package/dist/types/playwright/unstable/page-objects/userVerification.d.ts.map +1 -0
  99. package/dist/types/playwright/unstable/page-objects/waitlist.d.ts +48 -0
  100. package/dist/types/playwright/unstable/page-objects/waitlist.d.ts.map +1 -0
  101. package/package.json +52 -23
  102. package/playwright/package.json +5 -0
  103. package/dist/esm/index.js +0 -2
  104. package/dist/esm/index.js.map +0 -1
  105. package/dist/types/setup.d.ts.map +0 -1
  106. package/dist/types/setupClerkTestingToken.d.ts +0 -29
  107. package/dist/types/setupClerkTestingToken.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerk/testing",
3
- "version": "2.0.0-snapshot.v07d9254",
3
+ "version": "2.0.0-snapshot.v20251203203405",
4
4
  "description": "Utilities to help you create E2E test suites for apps using Clerk",
5
5
  "keywords": [
6
6
  "auth",
@@ -9,6 +9,7 @@
9
9
  "session",
10
10
  "jwt",
11
11
  "playwright",
12
+ "cypress",
12
13
  "testing",
13
14
  "e2e"
14
15
  ],
@@ -27,48 +28,76 @@
27
28
  "exports": {
28
29
  "./playwright": {
29
30
  "import": {
30
- "types": "./dist/types/index.d.ts",
31
- "default": "./dist/esm/index.js"
31
+ "types": "./dist/types/playwright/index.d.ts",
32
+ "default": "./dist/playwright/index.mjs"
32
33
  },
33
34
  "require": {
34
- "types": "./dist/types/index.d.ts",
35
- "default": "./dist/index.js"
35
+ "types": "./dist/types/playwright/index.d.ts",
36
+ "default": "./dist/playwright/index.js"
37
+ }
38
+ },
39
+ "./playwright/unstable": {
40
+ "import": {
41
+ "types": "./dist/types/playwright/unstable/index.d.ts",
42
+ "default": "./dist/playwright/unstable/index.mjs"
43
+ },
44
+ "require": {
45
+ "types": "./dist/types/playwright/unstable/index.d.ts",
46
+ "default": "./dist/playwright/unstable/index.js"
47
+ }
48
+ },
49
+ "./cypress": {
50
+ "import": {
51
+ "types": "./dist/types/cypress/index.d.ts",
52
+ "default": "./dist/cypress/index.mjs"
53
+ },
54
+ "require": {
55
+ "types": "./dist/types/cypress/index.d.ts",
56
+ "default": "./dist/cypress/index.js"
36
57
  }
37
58
  }
38
59
  },
60
+ "main": "./dist/index.js",
61
+ "module": "./dist/index.mjs",
62
+ "types": "./dist/types/index.d.ts",
39
63
  "files": [
40
- "dist"
64
+ "dist",
65
+ "playwright",
66
+ "cypress"
41
67
  ],
42
- "scripts": {
43
- "build": "tsup --env.NODE_ENV production",
44
- "clean": "rimraf ./dist",
45
- "dev": "tsup --watch",
46
- "lint": "eslint src/"
47
- },
48
68
  "dependencies": {
49
- "@clerk/shared": "2.0.0",
50
- "@clerk/types": "4.1.0-snapshot.v07d9254",
51
- "dotenv": "16.4.5"
69
+ "dotenv": "17.2.2",
70
+ "@clerk/backend": "^3.0.0-snapshot.v20251203203405",
71
+ "@clerk/shared": "^4.0.0-snapshot.v20251203203405"
52
72
  },
53
73
  "devDependencies": {
54
- "@playwright/test": "^1.43.1",
55
- "@types/node": "^18.17.0",
56
- "eslint-config-custom": "*",
57
- "tsup": "*",
58
- "typescript": "*"
74
+ "@playwright/test": "^1.56.1",
75
+ "cypress": "^14.5.4"
59
76
  },
60
77
  "peerDependencies": {
61
- "@playwright/test": "^1"
78
+ "@playwright/test": "^1",
79
+ "cypress": "^13 || ^14"
62
80
  },
63
81
  "peerDependenciesMeta": {
64
82
  "@playwright/test": {
65
83
  "optional": true
84
+ },
85
+ "cypress": {
86
+ "optional": true
66
87
  }
67
88
  },
68
89
  "engines": {
69
- "node": ">=18.17.0"
90
+ "node": ">=20.9.0"
70
91
  },
71
92
  "publishConfig": {
72
93
  "access": "public"
94
+ },
95
+ "scripts": {
96
+ "build": "tsup --env.NODE_ENV production",
97
+ "clean": "rimraf ./dist",
98
+ "dev": "tsup --watch",
99
+ "format": "node ../../scripts/format-package.mjs",
100
+ "format:check": "node ../../scripts/format-package.mjs --check",
101
+ "lint": "eslint src"
73
102
  }
74
- }
103
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../dist/playwright/index.js",
3
+ "module": "../dist/playwright/index.mjs",
4
+ "types": "../dist/types/playwright/index.d.ts"
5
+ }
package/dist/esm/index.js DELETED
@@ -1,2 +0,0 @@
1
- import{isProductionFromSecretKey as c,parsePublishableKey as a}from"@clerk/shared/keys";import _ from"dotenv";var l="https://api.clerk.com/v1/testing_tokens",K=async r=>{let p=n=>{r?.debug&&console.log(`Clerk: ${n}`)};p("Setting up Clerk..."),_.config({path:[".env.local",".env"]});let o=r?.publishableKey||process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY||process.env.VITE_CLERK_PUBLISHABLE_KEY||process.env.CLERK_PUBLISHABLE_KEY||process.env.GATSBY_CLERK_PUBLISHABLE_KEY||process.env.REACT_APP_CLERK_PUBLISHABLE_KEY||process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY,e=process.env.CLERK_SECRET_KEY,t=process.env.CLERK_TESTING_TOKEN;if(!o)throw new Error("You need to set the CLERK_PUBLISHABLE_KEY environment variable.");if(!e&&!t)throw new Error("You need to set the CLERK_SECRET_KEY or the CLERK_TESTING_KEY environment variable.");if(e&&!t){if(c(e))throw new Error("You are using a secret key from a production instance, but this helper only works for development instances.");let n={method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}};p("Fetching testing token from Clerk Backend API...");let s=process.env.CLERK_API_URL,E=s?`${s}/v1/testing_tokens`:l;await fetch(E,n).then(i=>i.json()).then(i=>{t=i.token}).catch(i=>{throw new Error("Failed to fetch testing token from Clerk API. Error: "+i)})}process.env.CLERK_FAPI=r?.frontendApiUrl||a(o)?.frontendApi,process.env.CLERK_TESTING_TOKEN=t};var L="__clerk_testing_token",T=async({page:r,options:p})=>{let o=p?.frontendApiUrl||process.env.CLERK_FAPI;if(!o)throw new Error("The Frontend API URL is required to bypass bot protection.");let e=`https://${o}/v1/**/*`;await r.route(e,(t,n)=>{let s=new URL(n.url()),E=process.env.CLERK_TESTING_TOKEN;E&&s.searchParams.set(L,E),t.continue({url:s.toString()})})};export{K as clerkSetup,T as setupClerkTestingToken};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/playwright/setup.ts","../../src/playwright/setupClerkTestingToken.ts"],"sourcesContent":["import { isProductionFromSecretKey, parsePublishableKey } from '@clerk/shared/keys';\nimport dotenv from 'dotenv';\n\ntype ClerkSetupParams = {\n /*\n * The publishable key for your Clerk dev instance.\n * If not provided, the library will look for the key in the following environment variables:\n * - NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY\n * - VITE_CLERK_PUBLISHABLE_KEY\n * - CLERK_PUBLISHABLE_KEY\n * - GATSBY_CLERK_PUBLISHABLE_KEY\n * - REACT_APP_CLERK_PUBLISHABLE_KEY\n * - EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY\n */\n publishableKey?: string;\n /*\n * The frontend API URL for your Clerk dev instance, without the protocol.\n * If provided, it overrides the Frontend API URL parsed from the publishable key.\n * Example: 'relieved-chamois-66.clerk.accounts.dev'\n */\n frontendApiUrl?: string;\n /*\n * Enable debug mode.\n */\n debug?: boolean;\n};\n\nconst TESTING_TOKEN_API_URL = 'https://api.clerk.com/v1/testing_tokens';\n\n/**\n * Sets up Clerk for testing by fetching the testing token from the Clerk Backend API.\n *\n * @param options.publishableKey - The publishable key for your Clerk dev instance.\n * @param options.frontendApiUrl - The frontend API URL for your Clerk dev instance, without the protocol. It overrides the Frontend API URL parsed from the publishable key.\n * @param options.debug - Enable debug logs.\n * @returns A promise that resolves when Clerk is set up.\n *\n * @throws An error if the publishable key or the secret key is not provided.\n * @throws An error if the secret key is from a production instance.\n * @throws An error if the testing token cannot be fetched from the Clerk Backend API.\n */\nexport const clerkSetup = async (options?: ClerkSetupParams) => {\n const log = (msg: string) => {\n if (options?.debug) {\n console.log(`Clerk: ${msg}`);\n }\n };\n\n log('Setting up Clerk...');\n dotenv.config({ path: ['.env.local', '.env'] });\n\n const publishableKey =\n options?.publishableKey ||\n process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY ||\n process.env.VITE_CLERK_PUBLISHABLE_KEY ||\n process.env.CLERK_PUBLISHABLE_KEY ||\n process.env.GATSBY_CLERK_PUBLISHABLE_KEY ||\n process.env.REACT_APP_CLERK_PUBLISHABLE_KEY ||\n process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY;\n\n const secretKey = process.env.CLERK_SECRET_KEY;\n let testingToken = process.env.CLERK_TESTING_TOKEN;\n\n if (!publishableKey) {\n throw new Error('You need to set the CLERK_PUBLISHABLE_KEY environment variable.');\n }\n\n if (!secretKey && !testingToken) {\n throw new Error('You need to set the CLERK_SECRET_KEY or the CLERK_TESTING_KEY environment variable.');\n }\n\n if (secretKey && !testingToken) {\n if (isProductionFromSecretKey(secretKey)) {\n throw new Error(\n 'You are using a secret key from a production instance, but this helper only works for development instances.',\n );\n }\n\n const options = {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${secretKey}`,\n 'Content-Type': 'application/json',\n },\n };\n\n log('Fetching testing token from Clerk Backend API...');\n\n const apiUrl = process.env.CLERK_API_URL;\n const testingTokenApiUrl = apiUrl ? `${apiUrl}/v1/testing_tokens` : TESTING_TOKEN_API_URL;\n\n await fetch(testingTokenApiUrl, options)\n .then(response => {\n return response.json();\n })\n .then(data => {\n testingToken = data.token;\n })\n .catch(reason => {\n throw new Error('Failed to fetch testing token from Clerk API. Error: ' + reason);\n });\n }\n\n process.env.CLERK_FAPI = options?.frontendApiUrl || parsePublishableKey(publishableKey)?.frontendApi;\n process.env.CLERK_TESTING_TOKEN = testingToken;\n};\n","import type { Page } from '@playwright/test';\n\ntype BypassBotProtectionParams = {\n page: Page;\n options?: {\n /*\n * The frontend API URL for your Clerk dev instance, without the protocol.\n * If provided, it overrides the Frontend API URL parsed from the publishable key.\n * Example: 'relieved-chamois-66.clerk.accounts.dev'\n */\n frontendApiUrl?: string;\n };\n};\n\nconst TESTING_TOKEN_PARAM = '__clerk_testing_token';\n\n/**\n * Bypasses bot protection by appending the testing token in the Frontend API requests.\n *\n * @param params.page - The Playwright page object.\n * @param params.options.frontendApiUrl - The frontend API URL for your Clerk dev instance, without the protocol.\n * @returns A promise that resolves when the bot protection bypass is set up.\n * @throws An error if the Frontend API URL is not provided.\n * @example\n * ```ts\n * import { setupClerkTestingToken } from '@clerk/testing/playwright';\n *\n * test('should bypass bot protection', async ({ page }) => {\n * await setupClerkTestingToken({ page });\n * await page.goto('https://your-app.com');\n * // Continue with your test...\n * });\n * ```\n *\n */\nexport const setupClerkTestingToken = async ({ page, options }: BypassBotProtectionParams) => {\n const fapiUrl = options?.frontendApiUrl || process.env.CLERK_FAPI;\n if (!fapiUrl) {\n throw new Error('The Frontend API URL is required to bypass bot protection.');\n }\n const apiUrl = `https://${fapiUrl}/v1/**/*`;\n\n await page.route(apiUrl, (route, request) => {\n const originalUrl = new URL(request.url());\n const testingToken = process.env.CLERK_TESTING_TOKEN;\n\n if (testingToken) {\n originalUrl.searchParams.set(TESTING_TOKEN_PARAM, testingToken);\n }\n\n route.continue({\n url: originalUrl.toString(),\n });\n });\n};\n"],"mappings":"AAAA,OAAS,6BAAAA,EAA2B,uBAAAC,MAA2B,qBAC/D,OAAOC,MAAY,SA0BnB,IAAMC,EAAwB,0CAcjBC,EAAa,MAAOC,GAA+B,CAC9D,IAAMC,EAAOC,GAAgB,CACvBF,GAAS,OACX,QAAQ,IAAI,UAAUE,CAAG,EAAE,CAE/B,EAEAD,EAAI,qBAAqB,EACzBJ,EAAO,OAAO,CAAE,KAAM,CAAC,aAAc,MAAM,CAAE,CAAC,EAE9C,IAAMM,EACJH,GAAS,gBACT,QAAQ,IAAI,mCACZ,QAAQ,IAAI,4BACZ,QAAQ,IAAI,uBACZ,QAAQ,IAAI,8BACZ,QAAQ,IAAI,iCACZ,QAAQ,IAAI,kCAERI,EAAY,QAAQ,IAAI,iBAC1BC,EAAe,QAAQ,IAAI,oBAE/B,GAAI,CAACF,EACH,MAAM,IAAI,MAAM,iEAAiE,EAGnF,GAAI,CAACC,GAAa,CAACC,EACjB,MAAM,IAAI,MAAM,qFAAqF,EAGvG,GAAID,GAAa,CAACC,EAAc,CAC9B,GAAIV,EAA0BS,CAAS,EACrC,MAAM,IAAI,MACR,8GACF,EAGF,IAAMJ,EAAU,CACd,OAAQ,OACR,QAAS,CACP,cAAe,UAAUI,CAAS,GAClC,eAAgB,kBAClB,CACF,EAEAH,EAAI,kDAAkD,EAEtD,IAAMK,EAAS,QAAQ,IAAI,cACrBC,EAAqBD,EAAS,GAAGA,CAAM,qBAAuBR,EAEpE,MAAM,MAAMS,EAAoBP,CAAO,EACpC,KAAKQ,GACGA,EAAS,KAAK,CACtB,EACA,KAAKC,GAAQ,CACZJ,EAAeI,EAAK,KACtB,CAAC,EACA,MAAMC,GAAU,CACf,MAAM,IAAI,MAAM,wDAA0DA,CAAM,CAClF,CAAC,CACL,CAEA,QAAQ,IAAI,WAAaV,GAAS,gBAAkBJ,EAAoBO,CAAc,GAAG,YACzF,QAAQ,IAAI,oBAAsBE,CACpC,EC3FA,IAAMM,EAAsB,wBAqBfC,EAAyB,MAAO,CAAE,KAAAC,EAAM,QAAAC,CAAQ,IAAiC,CAC5F,IAAMC,EAAUD,GAAS,gBAAkB,QAAQ,IAAI,WACvD,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,4DAA4D,EAE9E,IAAMC,EAAS,WAAWD,CAAO,WAEjC,MAAMF,EAAK,MAAMG,EAAQ,CAACC,EAAOC,IAAY,CAC3C,IAAMC,EAAc,IAAI,IAAID,EAAQ,IAAI,CAAC,EACnCE,EAAe,QAAQ,IAAI,oBAE7BA,GACFD,EAAY,aAAa,IAAIR,EAAqBS,CAAY,EAGhEH,EAAM,SAAS,CACb,IAAKE,EAAY,SAAS,CAC5B,CAAC,CACH,CAAC,CACH","names":["isProductionFromSecretKey","parsePublishableKey","dotenv","TESTING_TOKEN_API_URL","clerkSetup","options","log","msg","publishableKey","secretKey","testingToken","apiUrl","testingTokenApiUrl","response","data","reason","TESTING_TOKEN_PARAM","setupClerkTestingToken","page","options","fapiUrl","apiUrl","route","request","originalUrl","testingToken"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/playwright/setup.ts"],"names":[],"mappings":"AAGA,KAAK,gBAAgB,GAAG;IAWtB,cAAc,CAAC,EAAE,MAAM,CAAC;IAMxB,cAAc,CAAC,EAAE,MAAM,CAAC;IAIxB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,aAAoB,gBAAgB,kBAgE1D,CAAC"}
@@ -1,29 +0,0 @@
1
- import type { Page } from '@playwright/test';
2
- type BypassBotProtectionParams = {
3
- page: Page;
4
- options?: {
5
- frontendApiUrl?: string;
6
- };
7
- };
8
- /**
9
- * Bypasses bot protection by appending the testing token in the Frontend API requests.
10
- *
11
- * @param params.page - The Playwright page object.
12
- * @param params.options.frontendApiUrl - The frontend API URL for your Clerk dev instance, without the protocol.
13
- * @returns A promise that resolves when the bot protection bypass is set up.
14
- * @throws An error if the Frontend API URL is not provided.
15
- * @example
16
- * ```ts
17
- * import { setupClerkTestingToken } from '@clerk/testing/playwright';
18
- *
19
- * test('should bypass bot protection', async ({ page }) => {
20
- * await setupClerkTestingToken({ page });
21
- * await page.goto('https://your-app.com');
22
- * // Continue with your test...
23
- * });
24
- * ```
25
- *
26
- */
27
- export declare const setupClerkTestingToken: ({ page, options }: BypassBotProtectionParams) => Promise<void>;
28
- export {};
29
- //# sourceMappingURL=setupClerkTestingToken.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setupClerkTestingToken.d.ts","sourceRoot":"","sources":["../../src/playwright/setupClerkTestingToken.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE;QAMR,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH,CAAC;AAIF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,sBAA6B,yBAAyB,kBAmBxF,CAAC"}