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 instanceemail
(string): The user's emailpassword
(string): The user's password
Returns:
Promise resolving to
{ token, userId }
logout
logout({ authToken, userId, url })
Logs out a user by removing their authentication token.
Parameters:
authToken
(string): Authentication tokenuserId
(string): User IDurl
(string): Buzzy instance URL
Returns:
Promise resolving to logout response
Example:
const result = await logout({
authToken: 'your-auth-token',
userId: 'user-id',
url: 'https://your-buzzy-instance.com'
});
getUserID
getUserID({ authToken, userId, url, email })
Finds a user ID based on an email address.
Parameters:
authToken
(string): Authentication tokenuserId
(string): User ID of the requesting userurl
(string): The base URL of your Buzzy instanceemail
(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 MicroAppauthToken
(string): Authentication tokenuserId
(string): User ID of the requesting userurl
(string): The base URL of your Buzzy instancerowData
(object): The data to insertembeddingRowID
(string, optional): The ID of the embedding rowviewers
(array, optional): Array of user IDs who can view this rowuserID
(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 MicroAppauthToken
(string): Authentication tokenuserId
(string): User ID of the requesting userurl
(string): The base URL of your Buzzy instanceoptSearchFilters
(object, optional): Optional search filterssearchFilter
(object, optional): Primary search filteroptViewFilters
(object, optional): Optional view filters for filtering results, including geo/spatial queries usingsortValGeometry
(see geo/spatial query examples)optIsVectorSearch
(boolean, optional): Whether to use vector searchoptVectorSearchString
(string, optional): Vector search stringoptLimit
(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 rowauthToken
(string): Authentication tokenuserId
(string): User ID of the requesting userurl
(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 removeauthToken
(string): Authentication tokenuserId
(string): User ID of the requesting userurl
(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 updateauthToken
(string): Authentication tokenuserId
(string): User ID of the requesting userurl
(string): The base URL of your Buzzy instancerowData
(object): The new data for the rowcreatorID
(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 tokenuserId
(string): User ID of the requesting userurl
(string): The base URL of your Buzzy instanceorganizationInfo
(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 tokenuserId
(string): User ID of the requesting userurl
(string): The base URL of your Buzzy instanceteamInfo
(object): Information about the teamadminID
(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 tokenuserId
(string): User ID of the requesting userurl
(string): The base URL of your Buzzy instanceteamIDs
(array): Array of team IDsemails
(array, optional): Array of user emailsuserIDs
(array, optional): Array of user IDstargetInitialApp
(string, optional): Initial app for new userstargetInitialScreen
(string, optional): Initial screen for new userstargetRoute
(string, optional): Route for new users
Returns:
Promise resolving to the operation result
Advanced Team Management
enforceTeamMembership
enforceTeamMembership({ authToken, userId, url, userID, email, teamIDs })
Enforces team membership for a user by adding/removing them from specified teams.
Parameters:
authToken
(string): Authentication tokenuserId
(string): User ID making the requesturl
(string): Buzzy instance URLuserID
(string): User ID to manage (optional if email provided)email
(string): Email to manage (optional if userID provided)teamIDs
(array): Array of team IDs to enforce membership for
Returns:
Promise resolving to enforcement response
Example:
const result = await enforceTeamMembership({
authToken: 'your-auth-token',
userId: 'admin-user-id',
url: 'https://your-buzzy-instance.com',
email: '[email protected]',
teamIDs: ['team-id-1', 'team-id-2']
});
getTeamMembers
getTeamMembers({ authToken, userId, url, teamIDs })
Gets team members for specified teams.
Parameters:
authToken
(string): Authentication tokenuserId
(string): User IDurl
(string): Buzzy instance URLteamIDs
(array): Array of team IDs to get members for
Returns:
Promise resolving to team members response with array of user IDs
Example:
const result = await getTeamMembers({
authToken: 'your-auth-token',
userId: 'user-id',
url: 'https://your-buzzy-instance.com',
teamIDs: ['team-id-1', 'team-id-2']
});
AI-Powered App Creation
createAppWithPrompt
createAppWithPrompt({ url, apiKey, userEmail, appPrompt, attachments })
Creates an app using AI prompt.
Parameters:
url
(string): Buzzy instance URLapiKey
(string): API key for authenticationuserEmail
(string): User's emailappPrompt
(string): AI prompt for app creationattachments
(array, optional): Optional attachments array
Returns:
Promise resolving to app creation response with buzzID
Example:
const result = await createAppWithPrompt({
url: 'https://your-buzzy-instance.com',
apiKey: 'your-api-key',
userEmail: '[email protected]',
appPrompt: 'Create a task management app with user assignments',
attachments: []
});
S3 File Operations
copyS3File
copyS3File({ authToken, userId, url, sourceResourceID, destinationResourceID, fileKey, newFileKey })
Copies a file between S3 locations.
Parameters:
authToken
(string): Authentication tokenuserId
(string): User IDurl
(string): Buzzy instance URLsourceResourceID
(string): Source resource IDdestinationResourceID
(string): Destination resource IDfileKey
(string): File key to copynewFileKey
(string, optional): Optional new file key
Returns:
Promise resolving to copy response with signed URL
Example:
const result = await copyS3File({
authToken: 'your-auth-token',
userId: 'user-id',
url: 'https://your-buzzy-instance.com',
sourceResourceID: 'source-resource-id',
destinationResourceID: 'dest-resource-id',
fileKey: 'path/to/file.pdf'
});
uploadFileToS3
uploadFileToS3({ authToken, userId, url, resourceID, fieldID, fileUrl, filename })
Uploads a file to S3 from a URL.
Parameters:
authToken
(string): Authentication tokenuserId
(string): User IDurl
(string): Buzzy instance URLresourceID
(string): Resource IDfieldID
(string): Field IDfileUrl
(string): URL of file to uploadfilename
(string): Filename for the upload
Returns:
Promise resolving to upload response with URL
Example:
const result = await uploadFileToS3({
authToken: 'your-auth-token',
userId: 'user-id',
url: 'https://your-buzzy-instance.com',
resourceID: 'resource-id',
fieldID: 'field-id',
fileUrl: 'https://example.com/document.pdf',
filename: 'document.pdf'
});
Last updated