@formaloo/api-client
TypeScript icon, indicating that this package has built-in type declarations

1.7.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.7.0
    1
    • latest

Version History

Package Sidebar

Install

npm i @formaloo/api-client

Weekly Downloads

1

Version

1.7.0

License

MIT

Unpacked Size

269 kB

Total Files

28

Last publish

Collaborators

  • amirhashemei
  • formaloohq