@memberjunction/actions-apollo 2.43.0 → 2.44.0

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 (2) hide show
  1. package/README.md +266 -0
  2. package/package.json +5 -5
package/README.md ADDED
@@ -0,0 +1,266 @@
1
+ # @memberjunction/actions-apollo
2
+
3
+ Apollo.io data enrichment action classes for MemberJunction that enable automated enrichment of contact and account records using the Apollo.io API.
4
+
5
+ ## Overview
6
+
7
+ This package provides two primary action classes that integrate with Apollo.io's data enrichment services:
8
+
9
+ - **ApolloAccountsEnrichmentAction** - Enriches account/organization records with company information, technologies used, and associated contacts
10
+ - **ApolloContactsEnrichmentAction** - Enriches contact records with verified email addresses, employment history, and education details
11
+
12
+ These actions are designed to work within the MemberJunction framework and can be configured through action parameters to map Apollo.io data to your custom entity fields.
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @memberjunction/actions-apollo
18
+ ```
19
+
20
+ ## Prerequisites
21
+
22
+ 1. An active Apollo.io account with API access
23
+ 2. Apollo.io API key (set as environment variable `APOLLO_API_KEY`)
24
+ 3. MemberJunction framework properly configured
25
+ 4. Target entities for storing enriched data (Accounts, Contacts, etc.)
26
+
27
+ ## Configuration
28
+
29
+ ### Environment Variables
30
+
31
+ ```bash
32
+ APOLLO_API_KEY=your_apollo_api_key_here
33
+ ```
34
+
35
+ ### Configuration Constants
36
+
37
+ The package uses the following configuration values (defined in `config.ts`):
38
+
39
+ - `GroupSize`: 10 - Maximum records per API batch request
40
+ - `ConcurrentGroups`: 1 - Number of concurrent API request groups
41
+ - `MaxPeopleToEnrichPerOrg`: 500 - Maximum contacts to enrich per organization
42
+
43
+ ## Usage
44
+
45
+ ### Apollo Accounts Enrichment Action
46
+
47
+ This action enriches account/organization records by looking up company information using domain names.
48
+
49
+ #### Parameters
50
+
51
+ ```typescript
52
+ {
53
+ // Required - JSON mapping for account entity fields
54
+ AccountEntityFieldNameJSON: {
55
+ EntityName: "Accounts",
56
+ DomainParamName: "Domain",
57
+ AccountIDName: "ID",
58
+ EnrichedAtField: "LastEnrichedAt",
59
+ AddressFieldName: "Address",
60
+ CityFieldNameName: "City",
61
+ StateProvinceFieldName: "State",
62
+ PostalCodeFieldName: "PostalCode",
63
+ DescriptionFieldName: "Description",
64
+ PhoneNumberFieldName: "Phone",
65
+ CountryFieldName: "Country",
66
+ LinkedInFieldName: "LinkedIn",
67
+ LogoURLFieldName: "LogoURL",
68
+ FacebookFieldName: "Facebook",
69
+ TwitterFieldName: "Twitter",
70
+ ExtraFilter: "Domain IS NOT NULL AND LastEnrichedAt IS NULL"
71
+ },
72
+
73
+ // Optional - JSON mapping for technology tracking
74
+ AccountTechnologyEntityFieldNameJSON: {
75
+ EntityName: "AccountTechnologies",
76
+ AccountIDFieldName: "AccountID",
77
+ TechnologyIDFieldName: "TechnologyID",
78
+ MatchFoundFieldName: "MatchFound",
79
+ EndedUseAtFieldName: "EndedAt"
80
+ },
81
+
82
+ // Optional - JSON mapping for technology categories
83
+ TechnologyCategoryEntityFieldNameJSON: {
84
+ EntityName: "TechnologyCategories",
85
+ NameFieldName: "Name",
86
+ IDFieldName: "ID"
87
+ },
88
+
89
+ // Optional - JSON mapping for contacts
90
+ ContactEntityFieldNameJSON: {
91
+ EntityName: "Contacts",
92
+ EmailFieldName: "Email",
93
+ AccountIDFieldName: "AccountID",
94
+ FirstNameFieldName: "FirstName",
95
+ LastNameFieldName: "LastName",
96
+ // ... other field mappings
97
+ }
98
+ }
99
+ ```
100
+
101
+ #### Example Usage
102
+
103
+ ```typescript
104
+ import { ApolloAccountsEnrichmentAction } from '@memberjunction/actions-apollo';
105
+ import { ActionEngine } from '@memberjunction/actions';
106
+
107
+ // Register the action with the engine
108
+ const engine = new ActionEngine();
109
+ const action = new ApolloAccountsEnrichmentAction();
110
+
111
+ // Execute the action
112
+ const result = await engine.RunAction({
113
+ ActionName: 'Apollo Enrichment - Accounts',
114
+ Params: [
115
+ {
116
+ Name: 'AccountEntityFieldNameJSON',
117
+ Value: JSON.stringify({
118
+ EntityName: 'Accounts',
119
+ DomainParamName: 'Domain',
120
+ AccountIDName: 'ID',
121
+ EnrichedAtField: 'LastEnrichedAt',
122
+ // ... other mappings
123
+ })
124
+ }
125
+ ],
126
+ ContextUser: currentUser
127
+ });
128
+ ```
129
+
130
+ ### Apollo Contacts Enrichment Action
131
+
132
+ This action enriches contact records by matching on name and email combinations.
133
+
134
+ #### Parameters
135
+
136
+ ```typescript
137
+ {
138
+ EntityName: "Contacts", // Target entity name
139
+ EmailField: "Email", // Email field name
140
+ FirstNameField: "FirstName", // First name field name
141
+ LastNameField: "LastName", // Last name field name
142
+ AccountNameField: "AccountName", // Account name field name
143
+ EnrichedAtField: "LastEnrichedAt", // Enrichment timestamp field
144
+ FilterParam: "Email IS NOT NULL", // Filter for records to enrich
145
+ domainParam: "Domain", // Domain field name (optional)
146
+ linkedinParam: "LinkedIn", // LinkedIn URL field name (optional)
147
+
148
+ // Optional - Employment history field mappings
149
+ EmploymentHistoryFieldMappings: {
150
+ EmploymentHistoryEntityName: "ContactEmploymentHistory",
151
+ EmploymentHistoryContactIDFieldName: "ContactID",
152
+ EmploymentHistoryOrganizationFieldName: "Organization",
153
+ EmploymentHistoryTitleFieldName: "Title"
154
+ },
155
+
156
+ // Optional - Education history field mappings
157
+ EducationHistoryFieldMappings: {
158
+ EducationHistoryEntityName: "ContactEducationHistory",
159
+ EducationtHistoryContactIDFieldName: "ContactID",
160
+ EducationtHistoryInstitutionFieldName: "Institution",
161
+ EducationtHistoryDegreeFieldName: "Degree"
162
+ }
163
+ }
164
+ ```
165
+
166
+ #### Example Usage
167
+
168
+ ```typescript
169
+ import { ApolloContactsEnrichmentAction } from '@memberjunction/actions-apollo';
170
+
171
+ const result = await engine.RunAction({
172
+ ActionName: 'Apollo Enrichment - Contacts',
173
+ Params: [
174
+ { Name: 'EntityName', Value: 'Contacts' },
175
+ { Name: 'EmailField', Value: 'Email' },
176
+ { Name: 'FirstNameField', Value: 'FirstName' },
177
+ { Name: 'LastNameField', Value: 'LastName' },
178
+ { Name: 'AccountNameField', Value: 'AccountName' },
179
+ { Name: 'EnrichedAtField', Value: 'LastEnrichedAt' },
180
+ { Name: 'FilterParam', Value: 'Email IS NOT NULL AND LastEnrichedAt IS NULL' }
181
+ ],
182
+ ContextUser: currentUser
183
+ });
184
+ ```
185
+
186
+ ## Features
187
+
188
+ ### Account Enrichment
189
+ - Company information (address, phone, description, social media URLs)
190
+ - Technology stack detection and tracking
191
+ - Automatic contact discovery and creation
192
+ - Technology category management
193
+ - Historical technology usage tracking
194
+
195
+ ### Contact Enrichment
196
+ - Email verification and discovery
197
+ - Employment history tracking
198
+ - Education history tracking
199
+ - Social media profile URLs
200
+ - Title exclusion filtering (excludes students, volunteers, etc.)
201
+
202
+ ### Error Handling & Rate Limiting
203
+ - Automatic retry with exponential backoff for rate limits
204
+ - Handles both per-minute and per-hour rate limits
205
+ - Comprehensive error logging
206
+ - Batch processing to optimize API usage
207
+
208
+ ## API Integration
209
+
210
+ The package integrates with the following Apollo.io API endpoints:
211
+
212
+ - `/organizations/enrich` - Organization enrichment
213
+ - `/people/bulk_match` - Bulk contact matching
214
+ - `/mixed_people/search` - People search by domain
215
+
216
+ ## Dependencies
217
+
218
+ - `@memberjunction/core` - Core MemberJunction functionality
219
+ - `@memberjunction/core-entities` - Entity definitions
220
+ - `@memberjunction/actions` - Action framework
221
+ - `@memberjunction/global` - Global utilities
222
+ - `axios` - HTTP client for API requests
223
+
224
+ ## Best Practices
225
+
226
+ 1. **Batch Processing**: The actions automatically batch records to optimize API usage and respect rate limits.
227
+
228
+ 2. **Field Mapping**: Carefully map Apollo.io fields to your entity fields to ensure data consistency.
229
+
230
+ 3. **Filtering**: Use the filter parameters to process only records that need enrichment, avoiding unnecessary API calls.
231
+
232
+ 4. **Error Monitoring**: Monitor the action logs for failed enrichments and rate limit issues.
233
+
234
+ 5. **Data Quality**: The actions include validation for email domains and exclude certain titles to maintain data quality.
235
+
236
+ ## Limitations
237
+
238
+ - Maximum 10 records per bulk API request (Apollo.io limitation)
239
+ - Rate limits apply based on your Apollo.io subscription
240
+ - Personal emails may not be revealed in GDPR-compliant regions
241
+ - Some enrichment data may be incomplete depending on Apollo.io's data coverage
242
+
243
+ ## Troubleshooting
244
+
245
+ ### Common Issues
246
+
247
+ 1. **Missing API Key**: Ensure `APOLLO_API_KEY` environment variable is set
248
+ 2. **Rate Limits**: The action will automatically retry after waiting for rate limit windows
249
+ 3. **No Matches Found**: Check that input data (domains, emails) are valid and formatted correctly
250
+ 4. **Field Mapping Errors**: Verify that all mapped fields exist in your target entities
251
+
252
+ ### Debug Logging
253
+
254
+ The actions use MemberJunction's logging system. Monitor logs for:
255
+ - Enrichment progress
256
+ - API response details
257
+ - Error messages
258
+ - Rate limit notifications
259
+
260
+ ## Contributing
261
+
262
+ This package is part of the MemberJunction open-source project. Contributions are welcome following the project's contribution guidelines.
263
+
264
+ ## License
265
+
266
+ ISC License - see the MemberJunction project license for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/actions-apollo",
3
- "version": "2.43.0",
3
+ "version": "2.44.0",
4
4
  "description": "Action classes that wrap the Apollo.io data enrichment API for contacts and accounts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,10 +19,10 @@
19
19
  "typescript": "^5.4.5"
20
20
  },
21
21
  "dependencies": {
22
- "@memberjunction/global": "2.43.0",
23
- "@memberjunction/core": "2.43.0",
24
- "@memberjunction/core-entities": "2.43.0",
25
- "@memberjunction/actions": "2.43.0",
22
+ "@memberjunction/global": "2.44.0",
23
+ "@memberjunction/core": "2.44.0",
24
+ "@memberjunction/core-entities": "2.44.0",
25
+ "@memberjunction/actions": "2.44.0",
26
26
  "axios": "^1.7.2"
27
27
  }
28
28
  }