ZIPS User Updates
This simple repo helps consolidate the data flow necessary to find accurate zip codes and Congressional districts for Zendesk users.
Pseudocode usage below. See index.test.ts
for exact usage.
import ZIPSUserUpdates from '@indigov/zips-user-updates'
const zipsUserUpdates = ZIPSUserUpdates({
zipsUrl: 'https://zips.com',
zipsToken: 'token',
district: 'AZ-01',
cohort: 'ushor',
})
for (const user of await fetchAllZendeskUsers()) {
const userFields = await zipsUserUpdates(user)
if (userFields) {
await updateZendeskUser({
id: user.id,
user_fields: userFields,
})
}
}