Node.js API Client

The Buzzy API Node.js client provides a convenient way to interact with the Buzzy REST API from Node.js applications. This client handles authentication, request formatting, and response parsing, making it easier to use the API.

Installation

npm install buzzy-api-nodejs

Usage

import { 
  login, 
  insertMicroAppRow, 
  getMicroAppData 
} from 'buzzy-api-nodejs';

// Example: Login and get auth credentials
async function example() {
  const auth = await login({
    url: 'https://your-buzzy-instance.com',
    email: '[email protected]',
    password: 'password'
  });
  
  // Use auth credentials for other API calls
  const { token, userId } = auth;
  
  // Example: Get data from a MicroApp
  const rows = await getMicroAppData({
    microAppID: 'microAppID',
    authToken: token,
    userId: userId,
    url: 'https://your-buzzy-instance.com'
  });
  
  console.log(rows);
}

API Reference

login

login({ url, email, password })

Logs in a user and retrieves authentication token and user ID.

Parameters:

  • url (string): The base URL of your Buzzy instance

  • email (string): The user's email

  • password (string): The user's password

Returns:

  • Promise resolving to { token, userId }

getUserID

getUserID({ authToken, userId, url, email })

Finds a user ID based on an email address.

Parameters:

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

  • email (string): The email to look up

Returns:

  • Promise resolving to an object containing the user ID

insertMicroAppRow

insertMicroAppRow({
  microAppID,
  authToken,
  userId,
  url,
  rowData,
  embeddingRowID,
  viewers,
  userID
})

Inserts a new row into a specified MicroApp.

Parameters:

  • microAppID (string): The ID of the MicroApp

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

  • rowData (object): The data to insert

  • embeddingRowID (string, optional): The ID of the embedding row

  • viewers (array, optional): Array of user IDs who can view this row

  • userID (string, optional): The ID of the creator

Returns:

  • Promise resolving to an object containing the inserted row ID

getMicroAppData

getMicroAppData({
  microAppID,
  authToken,
  userId,
  url,
  optSearchFilters,
  searchFilter,
  optViewFilters,
  optIsVectorSearch,
  optVectorSearchString,
  optLimit
})

Retrieves data from a specified MicroApp.

Parameters:

  • microAppID (string): The ID of the MicroApp

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

  • optSearchFilters (object, optional): Optional search filters

  • searchFilter (object, optional): Primary search filter

  • optViewFilters (object, optional): Optional view filters for filtering results, including geo/spatial queries using sortValGeometry (see geo/spatial query examples)

  • optIsVectorSearch (boolean, optional): Whether to use vector search

  • optVectorSearchString (string, optional): Vector search string

  • optLimit (number, optional): Number of results to return

Returns:

  • Promise resolving to an array of rows

getMicroAppDataRow

getMicroAppDataRow({ rowID, authToken, userId, url })

Retrieves a specific row from a MicroApp.

Parameters:

  • rowID (string): The ID of the row

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

Returns:

  • Promise resolving to the row data

removeMicroAppRow

removeMicroAppRow(rowID, authToken, userId, url)

Removes a specific row from a MicroApp.

Parameters:

  • rowID (string): The ID of the row to remove

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

Returns:

  • Promise resolving to the operation result

updateMicroAppDataRow

updateMicroAppDataRow({
  rowID,
  authToken,
  userId,
  url,
  rowData,
  creatorID
})

Updates a specific row in a MicroApp.

Parameters:

  • rowID (string): The ID of the row to update

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

  • rowData (object): The new data for the row

  • creatorID (string, optional): The ID of the creator

Returns:

  • Promise resolving to a boolean indicating success

insertOrganization

insertOrganization({ authToken, userId, url, organizationInfo })

Creates a new organization.

Parameters:

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

  • organizationInfo (object): Information about the organization

Returns:

  • Promise resolving to the operation result

insertTeam

insertTeam({ authToken, userId, url, teamInfo, adminID })

Creates a new team within an organization.

Parameters:

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

  • teamInfo (object): Information about the team

  • adminID (string, optional): The ID of the admin user

Returns:

  • Promise resolving to the operation result

insertTeamMembers

insertTeamMembers({
  authToken,
  userId,
  url,
  teamIDs,
  emails,
  userIDs,
  targetInitialApp,
  targetInitialScreen,
  targetRoute
})

Adds members to teams.

Parameters:

  • authToken (string): Authentication token

  • userId (string): User ID of the requesting user

  • url (string): The base URL of your Buzzy instance

  • teamIDs (array): Array of team IDs

  • emails (array, optional): Array of user emails

  • userIDs (array, optional): Array of user IDs

  • targetInitialApp (string, optional): Initial app for new users

  • targetInitialScreen (string, optional): Initial screen for new users

  • targetRoute (string, optional): Route for new users

Returns:

  • Promise resolving to the operation result

Last updated