linkedin-secret-sauce 0.12.1 → 0.12.3

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