linkedin-secret-sauce 0.12.2 → 0.12.4

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 (162) hide show
  1. package/README.md +276 -40
  2. package/dist/enrichment/index.d.ts +22 -3
  3. package/dist/enrichment/index.js +29 -38
  4. package/dist/enrichment/matching.d.ts +4 -8
  5. package/dist/enrichment/matching.js +6 -5
  6. package/dist/enrichment/orchestrator.d.ts +1 -1
  7. package/dist/enrichment/orchestrator.js +51 -44
  8. package/dist/enrichment/providers/index.d.ts +0 -2
  9. package/dist/enrichment/providers/index.js +1 -8
  10. package/dist/enrichment/providers/snovio.d.ts +4 -4
  11. package/dist/enrichment/providers/snovio.js +14 -14
  12. package/dist/enrichment/types.d.ts +18 -71
  13. package/dist/enrichment/types.js +3 -8
  14. package/dist/enrichment/utils/rate-limiter.js +0 -2
  15. package/dist/index.d.ts +2 -4
  16. package/dist/index.js +2 -2
  17. package/docs/COSIALL_PROFILE_EMAILS.md +342 -0
  18. package/docs/ENRICHMENT.md +580 -0
  19. package/docs/INTEGRATION.md +403 -0
  20. package/docs/PLAYGROUND.md +553 -0
  21. package/docs/SALES_SEARCH.md +171 -0
  22. package/docs/api/.nojekyll +1 -0
  23. package/docs/api/assets/hierarchy.js +1 -0
  24. package/docs/api/assets/highlight.css +92 -0
  25. package/docs/api/assets/icons.js +18 -0
  26. package/docs/api/assets/icons.svg +1 -0
  27. package/docs/api/assets/main.js +60 -0
  28. package/docs/api/assets/navigation.js +1 -0
  29. package/docs/api/assets/search.js +1 -0
  30. package/docs/api/assets/style.css +1633 -0
  31. package/docs/api/classes/LinkedInClientError.html +37 -0
  32. package/docs/api/functions/_testGetAccountCookies.html +4 -0
  33. package/docs/api/functions/_testGetAccountEntry.html +4 -0
  34. package/docs/api/functions/_testGetAllAccountIds.html +3 -0
  35. package/docs/api/functions/_testGetPoolState.html +3 -0
  36. package/docs/api/functions/adminResetAccount.html +1 -0
  37. package/docs/api/functions/adminSetCooldown.html +1 -0
  38. package/docs/api/functions/buildCookieHeader.html +1 -0
  39. package/docs/api/functions/clearAllSmartLeadTokens.html +2 -0
  40. package/docs/api/functions/clearRequestHistory.html +1 -0
  41. package/docs/api/functions/clearSessionAccount.html +1 -0
  42. package/docs/api/functions/clearSmartLeadToken.html +2 -0
  43. package/docs/api/functions/createEnrichmentClient.html +8 -0
  44. package/docs/api/functions/extractCsrfToken.html +1 -0
  45. package/docs/api/functions/extractLinkedInHandle.html +7 -0
  46. package/docs/api/functions/fetchCookiesFromCosiall.html +14 -0
  47. package/docs/api/functions/fetchProfileEmailsFromCosiall.html +18 -0
  48. package/docs/api/functions/forceRefreshCookies.html +1 -0
  49. package/docs/api/functions/getAccountForSession.html +1 -0
  50. package/docs/api/functions/getAccountsSummary.html +1 -0
  51. package/docs/api/functions/getCompaniesBatch.html +5 -0
  52. package/docs/api/functions/getCompanyById.html +9 -0
  53. package/docs/api/functions/getCompanyByUrl.html +1 -0
  54. package/docs/api/functions/getConfig.html +1 -0
  55. package/docs/api/functions/getCookiePoolHealth.html +1 -0
  56. package/docs/api/functions/getProfileByUrn.html +17 -0
  57. package/docs/api/functions/getProfileByVanity.html +10 -0
  58. package/docs/api/functions/getProfilesBatch.html +1 -0
  59. package/docs/api/functions/getRequestHistory.html +1 -0
  60. package/docs/api/functions/getSalesNavigatorProfileDetails.html +1 -0
  61. package/docs/api/functions/getSalesNavigatorProfileFull.html +16 -0
  62. package/docs/api/functions/getSmartLeadToken.html +1 -0
  63. package/docs/api/functions/getSmartLeadTokenCacheStats.html +2 -0
  64. package/docs/api/functions/getSmartLeadUser.html +2 -0
  65. package/docs/api/functions/getSnapshot.html +1 -0
  66. package/docs/api/functions/getYearsAtCompanyOptions.html +2 -0
  67. package/docs/api/functions/getYearsInPositionOptions.html +2 -0
  68. package/docs/api/functions/getYearsOfExperienceOptions.html +2 -0
  69. package/docs/api/functions/incrementMetric.html +1 -0
  70. package/docs/api/functions/initializeCookiePool.html +1 -0
  71. package/docs/api/functions/initializeLinkedInClient.html +1 -0
  72. package/docs/api/functions/isBusinessEmail.html +4 -0
  73. package/docs/api/functions/isDisposableDomain.html +4 -0
  74. package/docs/api/functions/isDisposableEmail.html +4 -0
  75. package/docs/api/functions/isPersonalDomain.html +4 -0
  76. package/docs/api/functions/isPersonalEmail.html +4 -0
  77. package/docs/api/functions/isRoleAccount.html +4 -0
  78. package/docs/api/functions/isValidEmailSyntax.html +4 -0
  79. package/docs/api/functions/parseFullProfile.html +15 -0
  80. package/docs/api/functions/parseSalesSearchResults.html +1 -0
  81. package/docs/api/functions/reportAccountFailure.html +1 -0
  82. package/docs/api/functions/reportAccountSuccess.html +1 -0
  83. package/docs/api/functions/resolveCompanyUniversalName.html +1 -0
  84. package/docs/api/functions/searchSalesLeads.html +16 -0
  85. package/docs/api/functions/selectAccountForRequest.html +1 -0
  86. package/docs/api/functions/setAccountForSession.html +1 -0
  87. package/docs/api/functions/typeahead.html +1 -0
  88. package/docs/api/functions/verifyEmailMx.html +1 -0
  89. package/docs/api/hierarchy.html +1 -0
  90. package/docs/api/index.html +12 -0
  91. package/docs/api/interfaces/AccountCookies.html +4 -0
  92. package/docs/api/interfaces/BatchEnrichmentOptions.html +14 -0
  93. package/docs/api/interfaces/CacheAdapter.html +6 -0
  94. package/docs/api/interfaces/CanonicalEmail.html +14 -0
  95. package/docs/api/interfaces/Company.html +17 -0
  96. package/docs/api/interfaces/ConstructConfig.html +8 -0
  97. package/docs/api/interfaces/CosiallProfileEmailsResponse.html +11 -0
  98. package/docs/api/interfaces/EnrichmentCandidate.html +34 -0
  99. package/docs/api/interfaces/EnrichmentClient.html +10 -0
  100. package/docs/api/interfaces/EnrichmentClientConfig.html +12 -0
  101. package/docs/api/interfaces/EnrichmentLogger.html +6 -0
  102. package/docs/api/interfaces/EnrichmentOptions.html +10 -0
  103. package/docs/api/interfaces/HunterConfig.html +3 -0
  104. package/docs/api/interfaces/LddConfig.html +4 -0
  105. package/docs/api/interfaces/LddProfileData.html +6 -0
  106. package/docs/api/interfaces/LinkedInClientConfig.html +20 -0
  107. package/docs/api/interfaces/LinkedInCookie.html +9 -0
  108. package/docs/api/interfaces/LinkedInPosition.html +14 -0
  109. package/docs/api/interfaces/LinkedInProfile.html +21 -0
  110. package/docs/api/interfaces/LinkedInSpotlightBadge.html +5 -0
  111. package/docs/api/interfaces/LinkedInTenure.html +3 -0
  112. package/docs/api/interfaces/Metrics.html +22 -0
  113. package/docs/api/interfaces/MetricsSnapshot.html +23 -0
  114. package/docs/api/interfaces/ProfileEducation.html +8 -0
  115. package/docs/api/interfaces/ProfileEmailsLookupOptions.html +9 -0
  116. package/docs/api/interfaces/ProfilePosition.html +12 -0
  117. package/docs/api/interfaces/ProfileSkill.html +3 -0
  118. package/docs/api/interfaces/ProviderResult.html +11 -0
  119. package/docs/api/interfaces/ProvidersConfig.html +14 -0
  120. package/docs/api/interfaces/RequestHistoryEntry.html +8 -0
  121. package/docs/api/interfaces/SalesLeadSearchResult.html +31 -0
  122. package/docs/api/interfaces/SalesNavigatorContactInfo.html +5 -0
  123. package/docs/api/interfaces/SalesNavigatorPosition.html +11 -0
  124. package/docs/api/interfaces/SalesNavigatorProfile.html +9 -0
  125. package/docs/api/interfaces/SalesNavigatorProfileFull.html +24 -0
  126. package/docs/api/interfaces/SearchSalesResult.html +5 -0
  127. package/docs/api/interfaces/SmartLeadAuthConfig.html +6 -0
  128. package/docs/api/interfaces/SmartLeadCredentials.html +3 -0
  129. package/docs/api/interfaces/SmartLeadLoginResponse.html +3 -0
  130. package/docs/api/interfaces/SmartLeadUser.html +8 -0
  131. package/docs/api/interfaces/SmartProspectConfig.html +19 -0
  132. package/docs/api/interfaces/SmartProspectContact.html +24 -0
  133. package/docs/api/interfaces/SmartProspectSearchFilters.html +42 -0
  134. package/docs/api/interfaces/TypeaheadItem.html +3 -0
  135. package/docs/api/interfaces/TypeaheadResult.html +3 -0
  136. package/docs/api/interfaces/VerificationResult.html +16 -0
  137. package/docs/api/types/CostCallback.html +2 -0
  138. package/docs/api/types/Geo.html +4 -0
  139. package/docs/api/types/LddApiResponse.html +1 -0
  140. package/docs/api/types/ProviderFunc.html +2 -0
  141. package/docs/api/types/ProviderName.html +2 -0
  142. package/docs/api/types/SalesSearchFilters.html +7 -0
  143. package/docs/api/types/TypeaheadType.html +1 -0
  144. package/docs/api/variables/COMPANY_SIZE_OPTIONS.html +1 -0
  145. package/docs/api/variables/DEFAULT_PROVIDER_ORDER.html +19 -0
  146. package/docs/api/variables/DISPOSABLE_DOMAINS.html +2 -0
  147. package/docs/api/variables/FUNCTION_OPTIONS.html +1 -0
  148. package/docs/api/variables/INDUSTRY_OPTIONS.html +1 -0
  149. package/docs/api/variables/LANGUAGE_OPTIONS.html +1 -0
  150. package/docs/api/variables/PERSONAL_DOMAINS.html +2 -0
  151. package/docs/api/variables/PROVIDER_COSTS.html +13 -0
  152. package/docs/api/variables/REGION_OPTIONS.html +1 -0
  153. package/docs/api/variables/SENIORITY_OPTIONS.html +3 -0
  154. package/docs/api/variables/YEARS_OPTIONS.html +1 -0
  155. package/docs/index.html +98 -0
  156. package/package.json +40 -28
  157. package/dist/enrichment/providers/apollo.d.ts +0 -11
  158. package/dist/enrichment/providers/apollo.js +0 -181
  159. package/dist/enrichment/providers/bouncer.d.ts +0 -67
  160. package/dist/enrichment/providers/bouncer.js +0 -231
  161. package/dist/enrichment/providers/dropcontact.d.ts +0 -22
  162. package/dist/enrichment/providers/dropcontact.js +0 -206
@@ -0,0 +1,553 @@
1
+ # Playground
2
+
3
+ A comprehensive UI + API server for testing and exploring the LinkedIn Secret Sauce library locally. The playground provides interactive interfaces for all library features, with detailed visualizations, side-by-side provider comparisons, and real-time monitoring.
4
+
5
+ ---
6
+
7
+ ## Quick Start
8
+
9
+ ### Starting the Playground
10
+
11
+ From the repository root:
12
+
13
+ ```bash
14
+ # Development mode (recommended)
15
+ pnpm dev
16
+ # or
17
+ pnpm dev:playground
18
+
19
+ # This will:
20
+ # - Auto-detect free ports near 5175 (server) and 5173 (UI)
21
+ # - Print the chosen ports on startup
22
+ # - Open your browser automatically
23
+ # - Enable hot-reload for both client and server
24
+ ```
25
+
26
+ Alternative commands (from `apps/playground`):
27
+
28
+ ```bash
29
+ # Run both client and server
30
+ pnpm dev
31
+
32
+ # UI only (Vite dev server)
33
+ pnpm client
34
+
35
+ # Server only (Express API)
36
+ pnpm server
37
+ ```
38
+
39
+ The playground will print URLs like:
40
+ ```
41
+ Server: http://localhost:5175
42
+ UI: http://localhost:5173
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Environment Setup
48
+
49
+ Create `apps/playground/.env.local` or `.env` with your configuration:
50
+
51
+ ```bash
52
+ # === Proxy Configuration (Optional) ===
53
+ # Two formats supported:
54
+ # 1. URL format: http://user:pass@host:port
55
+ # 2. Colon format: host:port:user:pass
56
+ PROXY_STRING=proxy.example.net:16888:user:pass
57
+
58
+ # === LinkedIn Cookies (Required for most features) ===
59
+ # Cookie pool for LinkedIn API requests
60
+ # Format: accountId=cookieString, one per line
61
+ # See main library docs for cookie extraction guide
62
+ LINKEDIN_COOKIES="
63
+ account1=li_at=...; JSESSIONID=...
64
+ account2=li_at=...; JSESSIONID=...
65
+ "
66
+
67
+ # === LDD (LinkedIn Data Dump) ===
68
+ LDD_API_URL=https://your-ldd-api.com
69
+ LDD_API_TOKEN=your-ldd-token
70
+
71
+ # === SmartLead/SmartProspect ===
72
+ SMARTLEAD_EMAIL=your@email.com
73
+ SMARTLEAD_PASSWORD=your_password
74
+
75
+ # === Cosiall ===
76
+ COSIALL_API_URL=https://api.cosiall.com
77
+ COSIALL_API_KEY=your-cosiall-key
78
+
79
+ # === TryKitt.ai ===
80
+ TRYKITT_API_KEY=your-trykitt-key
81
+
82
+ # === BounceBan ===
83
+ BOUNCEBAN_API_KEY=your-bounceban-key
84
+
85
+ # === Hunter.io ===
86
+ HUNTER_API_KEY=your-hunter-key
87
+
88
+ # === Snov.io ===
89
+ SNOVIO_CLIENT_ID=your-snovio-client-id
90
+ SNOVIO_CLIENT_SECRET=your-snovio-secret
91
+
92
+ # === Port Configuration (Optional) ===
93
+ # Auto-increments if ports are busy
94
+ PLAYGROUND_SERVER_PORT=5175
95
+ PLAYGROUND_UI_PORT=5173
96
+ ```
97
+
98
+ **Note:** Most features work without paid API keys. The free tier includes:
99
+ - LinkedIn search and lookups (requires cookies)
100
+ - LDD lookups (requires LDD access)
101
+ - SmartProspect matching (FREE for FlexIQ)
102
+ - Cosiall lookups
103
+ - TryKitt.ai email finding
104
+ - Pattern guessing + MX validation
105
+
106
+ ---
107
+
108
+ ## Features Overview
109
+
110
+ The playground is organized into 6 main tabs, each with specialized sub-features:
111
+
112
+ ### 1. LinkedIn Tab
113
+ Test LinkedIn Sales Navigator and profile lookup features.
114
+
115
+ #### Sub-tabs:
116
+ - **Search** - Sales Navigator lead search with advanced filters
117
+ - **Profile Lookup** - Look up profiles by vanity name or Sales Navigator ID
118
+ - **Company Tools** - LinkedIn company lookup and data enrichment
119
+
120
+ #### Key Features:
121
+ - **Search Filters**: Industry, job title, location, seniority, company size, etc.
122
+ - **Pagination**: Navigate through search results with prev/next buttons
123
+ - **Card View**: Visual display of profile cards with key information
124
+ - **Find Email**: Click "Find Email" on any profile to jump to email enrichment
125
+ - **URL Copying**: Copy search URLs for sharing or automation
126
+ - **Query Inspection**: View the raw GraphQL query sent to LinkedIn
127
+
128
+ #### Use Cases:
129
+ - Build and test search queries before using in production
130
+ - Verify cookie health by running searches
131
+ - Extract profile data for enrichment workflows
132
+ - Test company lookup and website discovery
133
+
134
+ ---
135
+
136
+ ### 2. SmartLead Tab
137
+ Access the SmartProspect contact database.
138
+
139
+ #### Sub-tabs:
140
+ - **Email Lookup** - Find verified emails by name + company/domain
141
+ - **Contact Search** - Search SmartProspect database (SmartProspect filters)
142
+
143
+ #### Key Features:
144
+ - **Two Lookup Modes**:
145
+ - Search by Name: First/last name + company/domain → finds contact → fetches email
146
+ - Fetch by ID: Direct lookup with SmartProspect contact ID(s)
147
+ - **Batch Support**: Look up up to 100 contact IDs at once
148
+ - **Verification Status**: See email verification confidence (valid/catch-all/unverified)
149
+ - **Contact Matching**: Automatic matching between LinkedIn and SmartProspect contacts
150
+
151
+ #### Use Cases:
152
+ - Verify if a contact exists in SmartProspect before doing expensive lookups
153
+ - Bulk email fetching for known contact IDs
154
+ - Test contact matching accuracy
155
+ - FREE email lookups (no credits for FlexIQ customers)
156
+
157
+ ---
158
+
159
+ ### 3. LDD Tab
160
+ Query your private LinkedIn Data Dump database.
161
+
162
+ #### Features:
163
+ - **Multiple Lookup Methods**:
164
+ - Username (e.g., `williamhgates`)
165
+ - Full LinkedIn URL (auto-extracts username)
166
+ - Source Record ID
167
+ - Numeric LinkedIn ID
168
+ - **Data Retrieved**:
169
+ - Email addresses (with type classification)
170
+ - Phone numbers
171
+ - LinkedIn identifiers
172
+ - **Performance**: Instant lookups from local/private database
173
+ - **Cost**: 100% FREE - no external API calls
174
+
175
+ #### Use Cases:
176
+ - First-pass email lookup before trying paid providers
177
+ - Phone number extraction
178
+ - LinkedIn ID mapping and verification
179
+ - Bulk lookups without API costs
180
+
181
+ ---
182
+
183
+ ### 4. Cosiall Tab
184
+ Look up emails from the Cosiall FlexIQ database.
185
+
186
+ #### Features:
187
+ - **Lookup by**:
188
+ - LinkedIn vanity name (username)
189
+ - Full LinkedIn profile URL
190
+ - ObjectURN (most precise)
191
+ - **URL Normalization**: Handles missing `https://` and trailing slashes
192
+ - **Copy to Clipboard**: One-click copy for single or all emails
193
+ - **Multiple Emails**: Returns all known emails for a profile
194
+
195
+ #### Use Cases:
196
+ - Alternative to LDD for email lookups
197
+ - ObjectURN-based lookups from LinkedIn API responses
198
+ - Cross-reference emails from multiple sources
199
+
200
+ ---
201
+
202
+ ### 5. Email Tools Tab
203
+ Comprehensive email validation and verification utilities.
204
+
205
+ #### Sub-tabs:
206
+ - **Validate** - Email validation and classification
207
+ - **Provider Testing** - Side-by-side provider comparison
208
+ - **Matching Debugger** - Contact matching algorithm inspector
209
+
210
+ #### Validate Features:
211
+ - **Single Email Validation**:
212
+ - Syntax validation (RFC compliant)
213
+ - Personal vs. business classification
214
+ - Disposable email detection
215
+ - Role account detection (noreply@, info@, etc.)
216
+ - MX record verification
217
+ - **Batch Validation**: Up to 100 emails at once
218
+ - **Catch-All Detection**: Identify domains that accept all email addresses
219
+ - **Email Existence Check**: SMTP RCPT TO verification (up to 20 emails)
220
+ - Configurable delay to avoid rate limiting (1-10 seconds)
221
+ - Real-time status updates
222
+
223
+ #### Provider Testing Features:
224
+ - **Compare Multiple Providers**:
225
+ - LDD, SmartProspect, TryKitt.ai (FREE)
226
+ - Pattern Guessing + MX validation (FREE)
227
+ - BounceBan (catch-all verification, $0.003/lookup)
228
+ - Hunter.io ($0.015/lookup)
229
+ - Snov.io ($0.02/lookup)
230
+ - **Side-by-Side Results**: See speed, accuracy, and cost for each provider
231
+ - **Configuration Status**: Know which providers are configured
232
+ - **Cost Tracking**: See estimated cost per test run
233
+
234
+ #### Matching Debugger Features:
235
+ - **Field-by-Field Analysis**:
236
+ - Name matching (first, last, full name normalization)
237
+ - Title similarity (fuzzy matching, acronyms)
238
+ - Company matching (normalization, abbreviations)
239
+ - LinkedIn URL comparison
240
+ - **Weighted Scoring**: See how each field contributes to overall confidence
241
+ - **Match Quality Classification**: Exact, High, Medium, Low, None
242
+ - **Recommendations**: Actionable advice based on match score
243
+
244
+ #### Use Cases:
245
+ - Validate email lists before sending campaigns
246
+ - Identify catch-all domains that need special verification
247
+ - Compare provider accuracy and speed for your use case
248
+ - Debug why contacts aren't matching between LinkedIn and SmartProspect
249
+ - Understand the matching algorithm to improve data quality
250
+
251
+ ---
252
+
253
+ ### 6. Secret Sauce Tab
254
+ **Unified Email Lookup Workflow** - The complete email enrichment pipeline.
255
+
256
+ #### Features:
257
+ - **Intelligent Waterfall**: Queries providers in order until a verified email is found
258
+ 1. **Phase 1 (FREE)**: LDD → SmartProspect → Cosiall → TryKitt.ai → Pattern Guessing (parallel)
259
+ 2. **Phase 2 (Verification)**: BounceBan for catch-all domains
260
+ 3. **Phase 3 (Paid)**: Hunter.io → Snov.io (only if free providers fail)
261
+ - **Step-by-Step Visualization**: Watch each provider execute in real-time
262
+ - **LinkedIn Company Lookup**: Auto-discovers company domain from LinkedIn Company URN
263
+ - **Pattern Guessing**: Generates common email patterns (firstname.lastname@, etc.) + MX validation
264
+ - **Catch-All Handling**: Automatically uses BounceBan when domain is catch-all
265
+ - **Smart Thresholds**:
266
+ - Min Match Confidence (default 60%)
267
+ - Paid Provider Threshold (default 80%) - skip paid if confidence above this
268
+ - **Pre-fill from Search**: Click "Find Email" on any LinkedIn search result to auto-populate
269
+
270
+ #### Input Options:
271
+ - **Form Mode**: Fill individual fields
272
+ - **JSON Mode**: Paste entire LinkedIn contact object
273
+ - **Examples**: Pre-built examples including Sales Nav format
274
+
275
+ #### Contact Fields:
276
+ - **LinkedIn Identifiers**: ObjectURN (for LDD/Cosiall)
277
+ - **Profile Info**: First/last name, title, location
278
+ - **Company Info**: Name, URN (for domain discovery), website
279
+
280
+ #### Workflow Options:
281
+ - Toggle individual providers on/off
282
+ - Enable/disable paid providers
283
+ - Adjust confidence thresholds
284
+ - Configure SmartProspect matching sensitivity
285
+
286
+ #### Use Cases:
287
+ - Find emails for LinkedIn profiles with maximum accuracy
288
+ - Test the full enrichment pipeline end-to-end
289
+ - Compare free vs. paid provider results
290
+ - Optimize cost by adjusting thresholds
291
+ - Debug email lookup failures with detailed step logs
292
+
293
+ ---
294
+
295
+ ### 7. System Tab
296
+ Monitor playground health, logs, and costs.
297
+
298
+ #### Sub-tabs:
299
+ - **Accounts** - LinkedIn cookie pool management
300
+ - **Logs & Metrics** - Real-time logs, metrics, request history
301
+ - **Cost Analytics** - Track spending and estimate budgets
302
+
303
+ #### Accounts Features:
304
+ - **Cookie Pool Status**: See all LinkedIn accounts and their health
305
+ - **Health Indicators**: Healthy, Cooldown, Unhealthy
306
+ - **Account Actions**:
307
+ - Apply Cooldown: Temporarily disable an account (15s test)
308
+ - Reset: Clear failures and restore health
309
+ - Simulate Auth Fail: Test failure handling
310
+ - **Metadata**: Expiration dates, last used timestamps, failure counts
311
+ - **Automatic Selection**: Test the round-robin account picker
312
+
313
+ #### Logs & Metrics Features:
314
+ - **Live Logs (SSE)**: Real-time streaming logs from the server
315
+ - Last 200 entries kept in memory
316
+ - Auto-scroll to newest
317
+ - Copy to clipboard
318
+ - **Metrics Snapshot**: Current performance stats
319
+ - Request counts
320
+ - Error rates
321
+ - Cache hit rates
322
+ - Provider usage
323
+ - **Request History**: Full log of API calls
324
+ - Paginated view (50 per page)
325
+ - Request/response details
326
+ - Clear history button
327
+
328
+ #### Cost Analytics Features:
329
+ - **Provider Cost Reference**: Cost per lookup for each provider
330
+ - **Session Tracking**: Track costs since playground started
331
+ - **Budget Calculator**:
332
+ - Set monthly budget
333
+ - Estimate lookups/month
334
+ - See projected costs
335
+ - Budget usage percentage
336
+ - **Waterfall Strategy Diagram**: Visualize the provider pipeline
337
+ - **Assumptions**: 40% free resolution rate, avg paid cost $0.008
338
+
339
+ #### Use Cases:
340
+ - Monitor cookie health and rotation
341
+ - Debug API failures with real-time logs
342
+ - Estimate monthly costs for your use case
343
+ - Verify that free providers are being used first
344
+ - Track session spending during testing
345
+
346
+ ---
347
+
348
+ ## Tips for Effective Use
349
+
350
+ ### 1. Start with Free Providers
351
+ Before enabling paid APIs:
352
+ - Test LDD, SmartProspect, and Cosiall
353
+ - Use pattern guessing + MX validation
354
+ - Check catch-all status with the Email Tools tab
355
+ - Only enable paid providers if free ones have low success rates
356
+
357
+ ### 2. Use the Matching Debugger
358
+ If SmartProspect matches seem inaccurate:
359
+ - Copy LinkedIn contact to left panel
360
+ - Copy SmartProspect contact to right panel
361
+ - Review field-by-field scores
362
+ - Adjust data normalization or matching logic
363
+
364
+ ### 3. Optimize Costs
365
+ - Set `Paid Provider Threshold` to 80-90% to avoid redundant paid lookups
366
+ - Use batch lookups when possible
367
+ - Check catch-all status before pattern guessing
368
+ - Monitor costs in the Cost Analytics tab
369
+
370
+ ### 4. Test Cookies Regularly
371
+ - Run a simple LinkedIn search periodically
372
+ - Check the Accounts tab for failures
373
+ - Rotate or refresh cookies if seeing auth errors
374
+
375
+ ### 5. Use Examples
376
+ - Every tab has "Fill Example" buttons
377
+ - Examples demonstrate proper data formats
378
+ - Sales Nav example tests Company URN → domain lookup
379
+
380
+ ### 6. Leverage URL Parameters
381
+ The Secret Sauce tab accepts URL parameters for deep linking:
382
+ ```
383
+ ?tab=secret-sauce&firstName=John&lastName=Doe&companyName=Acme&objectUrn=urn:li:member:123
384
+ ```
385
+ This enables "Find Email" buttons from search results.
386
+
387
+ ### 7. Monitor Performance
388
+ - Watch step execution times in Unified Email Lookup
389
+ - Check provider response times in Provider Testing
390
+ - Review logs for slow queries or errors
391
+
392
+ ---
393
+
394
+ ## Troubleshooting
395
+
396
+ ### UI shows blank tab
397
+ - **Solution**: Refresh the page. Vite HMR will reconnect automatically.
398
+
399
+ ### Ports already in use
400
+ - **Solution**: The dev script auto-picks the next free port and logs it. Check console output.
401
+
402
+ ### No LinkedIn search results
403
+ - **Causes**:
404
+ - Invalid/expired cookies
405
+ - Cookie doesn't have Sales Navigator access
406
+ - LinkedIn rate limiting
407
+ - **Solutions**:
408
+ - Check Accounts tab for cookie health
409
+ - Try a different account (click "Simulate Selection")
410
+ - Refresh cookies from browser
411
+
412
+ ### Provider shows "Not configured"
413
+ - **Solution**: Add the required environment variables to `.env.local` (see Environment Setup above)
414
+
415
+ ### Pattern guessing finds too many emails
416
+ - **Cause**: Domain is catch-all (accepts all addresses)
417
+ - **Solution**: Enable BounceBan verification or use Hunter.io for confirmation
418
+
419
+ ### SmartProspect matches are inaccurate
420
+ - **Causes**:
421
+ - Name variations (nicknames, middle names)
422
+ - Company name differences (Inc. vs Corp, abbreviations)
423
+ - Outdated titles
424
+ - **Solutions**:
425
+ - Use Matching Debugger to see field scores
426
+ - Lower min confidence threshold
427
+ - Include more fields (title, company)
428
+
429
+ ### Email validation fails
430
+ - **Causes**:
431
+ - Invalid MX records
432
+ - Aggressive spam filtering
433
+ - Rate limiting on SMTP checks
434
+ - **Solutions**:
435
+ - Increase delay in Email Existence Check (5-10s)
436
+ - Use smaller batches (5-10 emails)
437
+ - Check catch-all status first
438
+
439
+ ---
440
+
441
+ ## Development Notes
442
+
443
+ ### Project Structure
444
+ ```
445
+ apps/playground/
446
+ ├── src/ # React UI
447
+ │ ├── ui/ # Tab components
448
+ │ │ ├── App.tsx # Main app with routing
449
+ │ │ ├── *Tab.tsx # Individual tab components
450
+ │ │ └── layout/ # Layout components
451
+ │ └── main.tsx # React entry point
452
+ ├── server/ # Express API
453
+ │ ├── index.ts # Server entry point
454
+ │ └── routes/ # API endpoints
455
+ ├── scripts/ # Dev utilities
456
+ │ └── dev.mjs # Concurrent dev server launcher
457
+ └── public/ # Static assets
458
+ ```
459
+
460
+ ### API Endpoints
461
+ The server exposes REST endpoints matching each tab's functionality:
462
+ - `/api/linkedin/*` - Search, profiles, companies
463
+ - `/api/smartlead/*` - SmartProspect lookups
464
+ - `/api/ldd/*` - LDD lookups
465
+ - `/api/cosiall/*` - Cosiall lookups
466
+ - `/api/email/*` - Validation, verification
467
+ - `/api/unified-email` - Full enrichment workflow
468
+ - `/api/providers/*` - Provider testing
469
+ - `/api/matching/*` - Contact matching
470
+ - `/api/accounts/*` - Cookie management
471
+ - `/api/logs/stream` - SSE log stream
472
+ - `/api/costs/*` - Cost tracking
473
+
474
+ ### Adding a New Provider
475
+ 1. Add API client to library (`src/providers/`)
476
+ 2. Add endpoint to playground server (`apps/playground/server/`)
477
+ 3. Add UI component (`apps/playground/src/ui/`)
478
+ 4. Update provider list in `ProviderTestingTab.tsx`
479
+ 5. Update cost reference in `CostAnalyticsTab.tsx`
480
+ 6. Add to waterfall in unified email workflow
481
+
482
+ ---
483
+
484
+ ## Advanced Features
485
+
486
+ ### Custom Search Filters
487
+ The LinkedIn Search tab supports all Sales Navigator filters:
488
+ - Boolean operators in keywords
489
+ - Nested location filters
490
+ - Custom date ranges
491
+ - Function + seniority combinations
492
+ - Company headcount ranges
493
+
494
+ ### Batch Operations
495
+ - SmartLead: Up to 100 contact IDs
496
+ - Email validation: Up to 100 emails
497
+ - Email existence: Up to 20 emails (to avoid SMTP blocks)
498
+
499
+ ### Real-time Monitoring
500
+ - SSE (Server-Sent Events) for live logs
501
+ - Auto-refresh for accounts/metrics (5s interval)
502
+ - Progress tracking for long-running operations
503
+
504
+ ### Export Capabilities
505
+ - Copy logs, metrics, search results to clipboard
506
+ - Copy email addresses (single or batch)
507
+ - Copy GraphQL queries for debugging
508
+ - Copy LinkedIn URLs for sharing
509
+
510
+ ---
511
+
512
+ ## Additional Resources
513
+
514
+ - **Library Docs**: See main [README.md](../README.md) for library usage
515
+ - **API Docs**: TypeDoc generated docs at `/docs/api/`
516
+ - **Code Search**: Use `pnpm search -- "pattern"` (wrapper for ripgrep)
517
+ - **Tests**: Run `pnpm test` for Vitest unit tests
518
+
519
+ ---
520
+
521
+ ## Performance Tips
522
+
523
+ ### Optimize Search Speed
524
+ - Use fewer filters to get faster responses
525
+ - Limit result count (10-25 per page)
526
+ - Enable caching on frequently-used searches
527
+
528
+ ### Reduce API Costs
529
+ - Always try free providers first (default behavior)
530
+ - Set high confidence thresholds for paid providers
531
+ - Use batch operations when possible
532
+ - Cache results locally
533
+
534
+ ### Avoid Rate Limiting
535
+ - Spread requests across multiple cookies (automatic)
536
+ - Use cooldowns when hitting 429 errors
537
+ - Add delays between batch operations
538
+ - Monitor logs for rate limit warnings
539
+
540
+ ---
541
+
542
+ ## Support
543
+
544
+ For issues or questions:
545
+ 1. Check this documentation
546
+ 2. Review the library [README.md](../README.md)
547
+ 3. Inspect browser console and server logs
548
+ 4. Use the Matching Debugger for contact issues
549
+ 5. Check environment variable configuration
550
+
551
+ ---
552
+
553
+ **Happy testing!** The playground is your sandbox for exploring LinkedIn Secret Sauce capabilities before integrating into production.