3.2.1 • Published 1 year ago

@evokegroup/pulse v3.2.1

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
1 year ago

@evokegroup/pulse

Helper library for interacting with the Pulse v3 API.

Requires NodeJS >18

Logging

Enable logging by configuring the API with a class/object that implements ILogger.

import { configure } from '@evokegroup/pulse';

// create a basic logger
/** @type {import('@evokegroup/pulse/dist-types').ILogger} **/
const BasicLogger = {
  info: (...msg) => {
    msg.forEach((m) => {
      console.log(m);
    });
  },
  debug: (...msg) => {
    BasicLogger.info.apply(null, msg);
  },
  warn: (...msg) => {
    BasicLogger.info.apply(null, msg);
  },
  error: (...msg) => {
    BasicLogger.info.apply(null, msg);
  }
};

configure({ logger: BasicLogger });

Example

Register a contact.

import { upsertContact } from '@evokegroup/pulse'

upsertContact({ 
  credentials: {
    host: 'PULSE_HOST',
    account: 'PULSE_ACCOUNT',
    token: 'PULSE_API_TOKEN'
  }, 
  contact: {
    isTest: true,
    firstName: 'John',
    lastName: 'Doe',
    customFields: {
      language: 'javascript'
    },
    emails: [{
      emailAddress: 'jdoe@gmail.com'
    }],
    locations: [{
      address1: '123 Main St',
      address2: '',
      city: 'Anytown',
      state: 'NY',
      postalCode: '12345'
    }],
    phones: [{
      phone: '212-555-8923'
    }]
  }
})
  .then((result) => {
    /* {
      status: 'CREATED or UPDATED',
      contact: {...}
    } */
  })
  .catch((err) => {
    // Could be PulseApiError if any error was returned by the API
  });
3.2.1

1 year ago

3.2.0

1 year ago

3.1.8

1 year ago

3.1.7

1 year ago

3.1.6

1 year ago

3.1.5

1 year ago

3.1.4

1 year ago

3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.9

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

1.0.11

3 years ago

1.0.12

3 years ago

1.0.9

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago