@formaloo/api-client

JS Client SDK for Formaloo API


Keywords
formaloo, sdk, typescript, library, cdp, form, javascript, api-client, javascript-library, sdk-js
License
MIT
Install
npm install @formaloo/api-client@1.6.0

Documentation

Formaloo JS API Client

npm (scoped) semantic-release Commitizen friendly

Installation

npm install --save @formaloo/api-client

Usage

  1. import library
  // using ES Modules
  import { Formaloo } from '@formaloo/api-client'
  // using CommonJS syntax
  const { Formaloo } = require('@formaloo/api-client')
  1. create instance with your credentials
  const formaloo = Formaloo.APIClient.create({
    apiKey,
    apiSecret,
    writeKey,
  })
  1. use available methods on client based on your needs
  • Please note that either useWriteKey or token should be present on all method calls. You can also create formaloo instance with only writeKey to create a write-only client.
  const response = await formaloo.customers.create({
    email: 'customer@email.com',
    phone_number: '+123456789',
    useWriteKey: true, // for create/update operations you might want to use your write-only key instead of access token
    token, // your access token obtained using your `KEY` and `SECRET`
  })

NOTES:

  1. DO NOT USE your secret on client side (apps running in browser)
  2. You might want to use your write-only in browser or less secure environments which has limited access to create or update (patch) your data.

Examples