Developer-friendly & type-safe Typescript SDK specifically catered to leverage firehydrant-typescript-sdk API.
The SDK can be installed with either npm, pnpm, bun or yarn package managers.
npm add firehydrant-typescript-sdk
pnpm add firehydrant-typescript-sdk
bun add firehydrant-typescript-sdk
yarn add firehydrant-typescript-sdk zod
# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.
For supported JavaScript runtimes, please consult RUNTIMES.md.
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
const firehydrantTypescriptSDK = new FirehydrantTypescriptSDK({
apiKey: process.env["FIREHYDRANTTYPESCRIPTSDK_API_KEY"] ?? "",
});
async function run() {
const result = await firehydrantTypescriptSDK.accountSettings
.getAiPreferences();
// Handle the result
console.log(result);
}
run();
This SDK supports the following security scheme globally:
Name | Type | Scheme | Environment Variable |
---|---|---|---|
apiKey |
apiKey | API key | FIREHYDRANTTYPESCRIPTSDK_API_KEY |
To authenticate with the API the apiKey
parameter must be set when initializing the SDK client instance. For example:
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
const firehydrantTypescriptSDK = new FirehydrantTypescriptSDK({
apiKey: process.env["FIREHYDRANTTYPESCRIPTSDK_API_KEY"] ?? "",
});
async function run() {
const result = await firehydrantTypescriptSDK.accountSettings
.getAiPreferences();
// Handle the result
console.log(result);
}
run();
Available methods
- getAiPreferences - Get AI preferences
- updateAiPreferences - Update AI preferences
- voteOnIncidentSummary - Vote on an AI-generated incident summary
- getBootstrap - Get initial application configuration and settings
- listEntitlements - List entitlements
- ping - Check API connectivity
- getSavedSearch - Get a saved search
- deleteSavedSearch - Delete a saved search
- updateSavedSearch - Update a saved search
- list - List alerts
- get - Get an alert
- listForIncident - List alerts for an incident
- create - Attach alerts to an incident
- listProcessingLogs - List alert processing log entries
- list - List events for an AWS CloudTrail batch
- listTypes - List change types
- list - List changes
- create - Create a change
- listEvents - List change events
- createEvent - Create a change event
- getEvent - Get a change event
- deleteEvent - Delete a change event
- updateEvent - Update a change event
- delete - Archive a change
- update - Update a change
- listIdentities - List identities for a change
- createIdentity - Create an identity for a change
- deleteIdentity - Delete an identity from a change
- updateIdentity - Update an identity for a change
- get - Get a scheduled maintenance event
- updateScheduledMaintenance - Update a scheduled maintenance event
- get - Get a checklist template
- listTemplates - List status update templates
- getTemplate - Get a status update template
- deleteStatusUpdateTemplate - Delete a status update template
- updateTemplate - Update a status update template
- listSpaces - List Confluence spaces
- listComments - List comments for a conversation
- createComment - Create a comment for a conversation
- getComment - Get a conversation comment
- deleteComment - Delete a conversation comment
- updateComment - Update a conversation comment
- listCommentReactions - List reactions for a conversation comment
- createCommentReaction - Create a reaction for a conversation comment
- deleteCommentReaction - Delete a reaction from a conversation comment
- list - List environments
- create - Create an environment
- get - Get an environment
- delete - Archive an environment
- update - Update an environment
- list - List functionalities
- create - Create a functionality
- get - Get a functionality
- delete - Archive a functionality
- update - Update a functionality
- listServices - List services for a functionality
- getAiSummaryVoteStatus - Get the vote status for an AI-generated incident summary
- list - List incidents
- create - Create an incident
- get - Get an incident
- archive - Archive an incident
- update - Update an incident
- deleteAlert - Delete an alert from an incident
- setAlertAsPrimary - Set an alert as primary for an incident
- listAttachments - List attachments for an incident
- createAttachment - Create an attachment for an incident
- getChannel - Get chat channel information for an incident
- close - Close an incident
- listEvents - List events for an incident
- getEvent - Get an incident event
- deleteEvent - Delete an incident event
- updateEvent - Update an incident event
- updateEventVotes - Update votes for an incident event
- getEventVoteStatus - Get vote counts for an incident event
- createGenericChatMessage - Create a chat message for an incident
- deleteChatMessage - Delete a chat message from an incident
- updateChatMessage - Update a chat message in an incident
- updateImpacts - Replace all impacts for an incident
- partialUpdateImpacts - Update impacts for an incident
- listImpact - List impacted infrastructure for an incident
- createImpact - Add impacted infrastructure to an incident
- deleteImpact - Remove impacted infrastructure from an incident
- listLinks - List links for an incident
- createLink - Create a link for an incident
- updateLink - Update an external link for an incident
- deleteLink - Delete an external link from an incident
- listMilestones - List milestones for an incident
- updateMilestonesBulk - Bulk update milestone timestamps for an incident
- createNote - Create a note for an incident
- updateNote - Update a note for an incident
- listRelatedChangeEvents - List related changes for an incident
- createRelatedChange - Add a related change to an incident
- updateRelatedChangeEvent - Update a related change event for an incident
- getRelationships - List incident relationships
- resolve - Resolve an incident
- listRoleAssignments - List role assignments for an incident
- createRoleAssignment - Create a role assignment for an incident
- deleteRoleAssignment - Delete a role assignment from an incident
- listSimilar - List similar incidents
- listStatusPages - List status pages for an incident
- addStatusPage - Add a status page to an incident
- createTaskList - Add tasks from a task list to an incident
- createTeamAssignment - Assign a team to an incident
- deleteTeamAssignment - Remove a team assignment from an incident
- getTranscript - List transcript messages for an incident
- deleteTranscript - Delete a transcript from an incident
- unarchive - Unarchive an incident
- getUserRole - Get a user's role in an incident
- listCustomFieldDefinitions - List custom field definitions
- createCustomFieldDefinition - Create a custom field definition
- deleteCustomFieldDefinition - Delete a custom field definition
- updateCustomFieldDefinition - Update a custom field definition
- listSelectOptions - List select options for a custom field
- getFormConfiguration - Get a form configuration
- listRoles - List incident roles
- createIncidentRole - Create an incident role
- getIncidentRole - Get an incident role
- deleteRole - Archive an incident role
- updateIncidentRole - Update an incident role
- listIncidentTags - List incident tags
- validateIncidentTags - Validate incident tags
- listIncidentTypes - List incident types
- createIncidentType - Create an incident type
- getIncidentType - Get an incident type
- archiveIncidentType - Archive an incident type
- updateType - Update an incident type
- createMilestone - Create a milestone for an incident lifecycle
- deleteLifecycleMilestone - Delete a lifecycle milestone
- updateLifecycleMilestone - Update a lifecycle milestone
- listLifecyclePhases - List lifecycle phases and milestones
- listPriorities - List priorities
- createPriority - Create a priority
- getPriority - Get a priority
- deletePriority - Delete a priority
- updatePriority - Update a priority
- listSeverities - List severities
- createSeverity - Create a severity
- getSeverity - Get a severity
- deleteSeverity - Delete a severity
- updateSeverity - Update a severity
- getSeverityMatrix - Get severity matrix
- updateSeverityMatrix - Update severity matrix
- listSeverityMatrixConditions - List severity matrix conditions
- createSeverityMatrixCondition - Create a severity matrix condition
- getSeverityMatrixCondition - Get a severity matrix condition
- deleteSeverityMatrixCondition - Delete a severity matrix condition
- updateCondition - Update a severity matrix condition
- listSeverityMatrixImpacts - List severity matrix impacts
- createImpact - Create a severity matrix impact
- deleteSeverityMatrixImpact - Delete an impact from the severity matrix
- updateImpact - Update an impact in the severity matrix
- listTicketingPriorities - List ticketing priorities
- createTicketingPriority - Create a ticketing priority
- list - List catalog entries
- list - List all available integrations
- listCloudtrailBatches - List AWS CloudTrail batches
- updateCloudTrailBatch - Update an AWS CloudTrail batch
- listConnections - List integration connections
- createConnection - Create a new integration connection
- updateConnection - Update an integration connection
- refreshConnection - Refresh an integration connection
- updateFieldMap - Update a field mapping configuration
- getFieldMapAvailableFields - List available fields for field mapping
- listEmojiActions - List Slack emoji actions
- getStatus - Get an integration status
- getStatuspageConnection - Get a Statuspage connection
- deleteStatuspageConnection - Delete a Statuspage connection
- get - Get an integration
- deletePriority - Delete a ticketing priority
- updatePriority - Update a ticketing priority
- listProjects - List ticketing projects
- getProjectConfigurationOptions - List configuration options for a ticketing project
- getProjectFieldOptions - List configuration options for a ticketing project field
- createFieldMap - Create a field mapping for a ticketing project
- getAvailableFields - List available fields for ticket field mapping
- deleteFieldMap - Delete a field map for a ticketing project
- updateTicketingFieldMap - Update a field map for a ticketing project
- deleteProjectConfig - Delete a ticketing project configuration
- getTicket - Get a ticket
- getCloudTrailBatch - Get an AWS CloudTrail batch
- updateConnection - Update an AWS connection
- getEmojiAction - Get a Slack emoji action
- deleteEmojiAction - Delete a Slack emoji action
- listWorkspaces - List Slack workspaces for a connection
- listConnections - List Statuspage connections
- listPages - List StatusPage pages for a connection
- getProject - Get a ticketing project
- listTags - List ticket tags
- list - List scheduled maintenance events
- create - Create a scheduled maintenance event
- delete - Delete a scheduled maintenance event
- getInfrastructure - Get metrics for a specific catalog entry
- listMeasurementDefinitions - List measurement definitions
- createMeasurementDefinition - Create a measurement definition
- getMeasurementDefinition - Get a measurement definition
- deleteMeasurementDefinition - Archive a measurement definition
- updateMeasurementDefinition - Update a measurement definition
- listIncidentMetrics - List incident metrics and analytics
- listRetrospectives - List retrospective metrics for a date range
- listUserInvolvementMetrics - List user involvement metrics
- listInfrastructureMetrics - List metrics for all services, environments, functionalities, or customers
- getMeanTime - Get mean time metrics for incidents
- listSavedSearches - List saved searches
- createSavedSearch - Create a saved search
- delete - Delete an on-call schedule for a team
- listQuestions - List retrospective questions
- updateQuestions - Update retrospective questions
- getQuestion - Get a retrospective question
- listReports - List retrospective reports
- createReport - Create a retrospective report
- getReport - Get a retrospective report
- updateReport - Update a retrospective report
- updateField - Update a retrospective field
- publishReport - Publish a retrospective report
- listReportReasons - List contributing factors for a retrospective report
- createReason - Create a contributing factor for a retrospective report
- updateReportReasonOrder - Update the order of contributing factors in a retrospective report
- deleteReason - Delete a contributing factor from a retrospective report
- updateReason - Update a contributing factor in a retrospective report
- listAudits - List runbook audits
- list - List runbooks
- create - Create a runbook
- listActions - List runbook actions
- listExecutions - List runbook executions
- createExecution - Create a runbook execution
- getExecution - Get a runbook execution
- updateExecutionStep - Update a runbook execution step
- getExecutionStepScript - Get a runbook execution step script
- updateExecutionStepScriptState - Update the script state for a runbook execution step
- updateExecutionStepVotes - Update votes for a runbook execution step
- getStepVoteStatus - Get vote counts for a runbook step
- updateExecutionVotes - Vote on a runbook execution
- getExecutionVoteStatus - Get vote counts for a runbook execution
- listSelectOptions - List select options for a runbook integration action field
- get - Get a runbook
- update - Update a runbook
- delete - Delete a runbook
- delete - Terminate a runbook execution
- listGroups - List teams via SCIM
- create - Create a team via SCIM
- getGroup - Get a SCIM group
- updateGroup - Update a SCIM group
- deleteGroup - Delete a SCIM group
- listUsers - List users via SCIM
- createUser - Create a user via SCIM
- getUser - Get a SCIM user
- replaceUser - Replace a SCIM user
- deleteUser - Delete a SCIM user
- updateUser - Update a SCIM user
- createDependency - Create a dependency relationship between services
- getDependency - Get a service dependency
- deleteDependency - Delete a service dependency
- update - Update a service dependency
- list - List services
- create - Create a service
- createLinks - Create multiple services and link them to external services
- get - Get a service
- delete - Delete a service
- patch - Update a service
- getAvailableDownstreamDependencies - List available downstream service dependencies
- listAvailableUpstreamDependencies - List available upstream service dependencies
- createChecklistResponse - Create a checklist response for a service
- listDependencies - List dependencies for a service
- deleteLink - Delete a service link
- listForUser - List services for a user's teams
- listGroupedMetrics - List grouped signal alert metrics
- getMttxAnalytics - Get MTTX analytics for signals
- getAnalyticsTimeseries - List timeseries metrics for signal alerts
- debug - Debug a signal
- listEmailTargets - List email targets for signals
- createEmailTarget - Create an email target for signals
- getEmailTarget - Get a signal email target
- deleteEmailTarget - Delete a signal email target
- updateEmailTarget - Update a signal email target
- listEventSources - List event sources for signals
- getIngestUrl - Get signal ingestion URL
- listTransposers - List signal transposers
- listWebhookTargets - List webhook targets for signals
- createWebhookTarget - Create a webhook target for signals
- getWebhookTarget - Get a webhook target
- deleteWebhookTarget - Delete a webhook target
- updateWebhookTarget - Update a webhook target
- listOnCall - List on-call schedules
- listEscalationPolicies - List escalation policies for a team
- deleteEscalationPolicy - Delete an escalation policy for a team
- getOnCallSchedule - Get an on-call schedule for a team
- updateOnCallSchedule - Update an on-call schedule for a team
- listRules - List signal rules for a team
- createRule - Create a signal rule for a team
- getRule - Get a signal rule
- deleteRule - Delete a signal rule
- updateRule - Update a signal rule
- getEscalationPolicy - Get an escalation policy for a team
- createEmojiAction - Create a Slack emoji action
- updateEmojiAction - Update a Slack emoji action
- listUsergroups - List Slack usergroups
- updateConnection - Update a Statuspage connection
- deleteIncident - Remove a status page from an incident
- createSubscription - Create a status page subscription
- deleteSubscription - Unsubscribe from status page notifications
- list - List status pages
- create - Create a status page
- get - Get a status page
- update - Update a status page
- delete - Delete a status page
- createComponentGroup - Create a component group for a status page
- deleteComponentGroup - Delete a status page component group
- updateComponentGroup - Update a status page component group
- updateImage - Upload an image for a status page
- deleteImage - Delete an image from a status page
- createLink - Create a link for a status page
- deleteLink - Delete a status page link
- updateLink - Update a status page link
- listSubscribers - List status page subscribers
- createSubscribers - Add subscribers to a status page
- deleteSubscribers - Remove subscribers from a status page
- create - Create a status update template
- ping - Check API connectivity
- listChecklistTemplates - List checklist templates
- createChecklistTemplate - Create a checklist template
- deleteChecklistTemplate - Archive a checklist template
- updateChecklistTemplate - Update a checklist template
- listForIncident - List tasks for an incident
- create - Create a task for an incident
- getForIncident - Get a task for an incident
- delete - Delete a task from an incident
- updateTask - Update a task for an incident
- convertToFollowup - Convert a task to a follow-up
- listTasks - List task lists
- createList - Create a task list
- get - Get a task list
- update - Update a task list
- delete - Delete a task list
- listSchedules - List schedules
- list - List teams
- create - Create a team
- get - Get a team
- archive - Archive a team
- update - Update a team
- listOnCallSchedules - List on-call schedules for a team
- createOnCallSchedule - Create an on-call schedule for a team
- getScheduleShift - Get an on-call shift for a team schedule
- deleteScheduleShift - Delete an on-call shift from a team schedule
- updateScheduleShift - Update an on-call shift in a team schedule
- createEscalationPolicy - Create an escalation policy for a team
- updateEscalationPolicy - Update an escalation policy for a team
- createShift - Create a shift for an on-call schedule
- getFieldMap - Get a field map for a ticketing project
- updateProjectConfig - Update a ticketing project configuration
- get - Get a ticketing priority
- getCurrent - Get the currently authenticated user
- list - List users
- get - Get a user
- list - List webhooks
- create - Create a webhook
- get - Get a webhook
- delete - Delete a webhook
- update - Update a webhook
- listDeliveries - List webhook deliveries
- searchTickets - Search for Zendesk tickets
All the methods listed above are available as standalone functions. These functions are ideal for use in applications running in the browser, serverless runtimes or other environments where application bundle size is a primary concern. When using a bundler to build your application, all unused functionality will be either excluded from the final bundle or tree-shaken away.
To read more about standalone functions, check FUNCTIONS.md.
Available standalone functions
accountSettingsDeleteSavedSearch
- Delete a saved searchaccountSettingsGetAiPreferences
- Get AI preferencesaccountSettingsGetBootstrap
- Get initial application configuration and settingsaccountSettingsGetSavedSearch
- Get a saved searchaccountSettingsListEntitlements
- List entitlementsaccountSettingsPing
- Check API connectivityaccountSettingsUpdateAiPreferences
- Update AI preferencesaccountSettingsUpdateSavedSearch
- Update a saved searchaccountSettingsVoteOnIncidentSummary
- Vote on an AI-generated incident summaryalertsCreate
- Attach alerts to an incidentalertsGet
- Get an alertalertsList
- List alertsalertsListForIncident
- List alerts for an incidentalertsListProcessingLogs
- List alert processing log entriesawsCloudtrailBatchEventsList
- List events for an AWS CloudTrail batchawsConnectionsGet
- Get an AWS connectionawsConnectionsList
- List AWS integration connectionschangesCreate
- Create a changechangesCreateEvent
- Create a change eventchangesCreateIdentity
- Create an identity for a changechangesDelete
- Archive a changechangesDeleteEvent
- Delete a change eventchangesDeleteIdentity
- Delete an identity from a changechangesGet
- Get a scheduled maintenance eventchangesGetEvent
- Get a change eventchangesList
- List changeschangesListEvents
- List change eventschangesListIdentities
- List identities for a changechangesListTypes
- List change typeschangesUpdate
- Update a changechangesUpdateEvent
- Update a change eventchangesUpdateIdentity
- Update an identity for a changechangesUpdateScheduledMaintenance
- Update a scheduled maintenance eventchecklistTemplatesGet
- Get a checklist templatecommunicationDeleteStatusUpdateTemplate
- Delete a status update templatecommunicationGetTemplate
- Get a status update templatecommunicationListTemplates
- List status update templatescommunicationUpdateTemplate
- Update a status update templateconfluenceListSpaces
- List Confluence spacesconversationsCreateComment
- Create a comment for a conversationconversationsCreateCommentReaction
- Create a reaction for a conversation commentconversationsDeleteComment
- Delete a conversation commentconversationsDeleteCommentReaction
- Delete a reaction from a conversation commentconversationsGetComment
- Get a conversation commentconversationsListCommentReactions
- List reactions for a conversation commentconversationsListComments
- List comments for a conversationconversationsUpdateComment
- Update a conversation commentenvironmentsCreate
- Create an environmentenvironmentsDelete
- Archive an environmentenvironmentsGet
- Get an environmentenvironmentsList
- List environmentsenvironmentsUpdate
- Update an environmentfunctionalitiesCreate
- Create a functionalityfunctionalitiesDelete
- Archive a functionalityfunctionalitiesGet
- Get a functionalityfunctionalitiesList
- List functionalitiesfunctionalitiesListServices
- List services for a functionalityfunctionalitiesUpdate
- Update a functionalityincidentsAddStatusPage
- Add a status page to an incidentincidentsArchive
- Archive an incidentincidentsClose
- Close an incidentincidentsCreate
- Create an incidentincidentsCreateAttachment
- Create an attachment for an incidentincidentsCreateGenericChatMessage
- Create a chat message for an incidentincidentsCreateImpact
- Add impacted infrastructure to an incidentincidentsCreateLink
- Create a link for an incidentincidentsCreateNote
- Create a note for an incidentincidentsCreateRelatedChange
- Add a related change to an incidentincidentsCreateRoleAssignment
- Create a role assignment for an incidentincidentsCreateTaskList
- Add tasks from a task list to an incidentincidentsCreateTeamAssignment
- Assign a team to an incidentincidentsDeleteAlert
- Delete an alert from an incidentincidentsDeleteChatMessage
- Delete a chat message from an incidentincidentsDeleteEvent
- Delete an incident eventincidentsDeleteImpact
- Remove impacted infrastructure from an incidentincidentsDeleteLink
- Delete an external link from an incidentincidentsDeleteRoleAssignment
- Delete a role assignment from an incidentincidentsDeleteTeamAssignment
- Remove a team assignment from an incidentincidentsDeleteTranscript
- Delete a transcript from an incidentincidentSettingsArchiveIncidentType
- Archive an incident typeincidentSettingsCreateCustomFieldDefinition
- Create a custom field definitionincidentSettingsCreateImpact
- Create a severity matrix impactincidentSettingsCreateIncidentRole
- Create an incident roleincidentSettingsCreateIncidentType
- Create an incident typeincidentSettingsCreateMilestone
- Create a milestone for an incident lifecycleincidentSettingsCreatePriority
- Create a priorityincidentSettingsCreateSeverity
- Create a severityincidentSettingsCreateSeverityMatrixCondition
- Create a severity matrix conditionincidentSettingsCreateTicketingPriority
- Create a ticketing priorityincidentSettingsDeleteCustomFieldDefinition
- Delete a custom field definitionincidentSettingsDeleteLifecycleMilestone
- Delete a lifecycle milestoneincidentSettingsDeletePriority
- Delete a priorityincidentSettingsDeleteRole
- Archive an incident roleincidentSettingsDeleteSeverity
- Delete a severityincidentSettingsDeleteSeverityMatrixCondition
- Delete a severity matrix conditionincidentSettingsDeleteSeverityMatrixImpact
- Delete an impact from the severity matrixincidentSettingsGetFormConfiguration
- Get a form configurationincidentSettingsGetIncidentRole
- Get an incident roleincidentSettingsGetIncidentType
- Get an incident typeincidentSettingsGetPriority
- Get a priorityincidentSettingsGetSeverity
- Get a severityincidentSettingsGetSeverityMatrix
- Get severity matrixincidentSettingsGetSeverityMatrixCondition
- Get a severity matrix conditionincidentSettingsListCustomFieldDefinitions
- List custom field definitionsincidentSettingsListIncidentTags
- List incident tagsincidentSettingsListIncidentTypes
- List incident typesincidentSettingsListLifecyclePhases
- List lifecycle phases and milestonesincidentSettingsListPriorities
- List prioritiesincidentSettingsListRoles
- List incident rolesincidentSettingsListSelectOptions
- List select options for a custom fieldincidentSettingsListSeverities
- List severitiesincidentSettingsListSeverityMatrixConditions
- List severity matrix conditionsincidentSettingsListSeverityMatrixImpacts
- List severity matrix impactsincidentSettingsListTicketingPriorities
- List ticketing prioritiesincidentSettingsUpdateCondition
- Update a severity matrix conditionincidentSettingsUpdateCustomFieldDefinition
- Update a custom field definitionincidentSettingsUpdateImpact
- Update an impact in the severity matrixincidentSettingsUpdateIncidentRole
- Update an incident roleincidentSettingsUpdateLifecycleMilestone
- Update a lifecycle milestoneincidentSettingsUpdatePriority
- Update a priorityincidentSettingsUpdateSeverity
- Update a severityincidentSettingsUpdateSeverityMatrix
- Update severity matrixincidentSettingsUpdateType
- Update an incident typeincidentSettingsValidateIncidentTags
- Validate incident tagsincidentsGet
- Get an incidentincidentsGetAiSummaryVoteStatus
- Get the vote status for an AI-generated incident summaryincidentsGetChannel
- Get chat channel information for an incidentincidentsGetEvent
- Get an incident eventincidentsGetEventVoteStatus
- Get vote counts for an incident eventincidentsGetRelationships
- List incident relationshipsincidentsGetTranscript
- List transcript messages for an incidentincidentsGetUserRole
- Get a user's role in an incidentincidentsList
- List incidentsincidentsListAttachments
- List attachments for an incidentincidentsListEvents
- List events for an incidentincidentsListImpact
- List impacted infrastructure for an incidentincidentsListLinks
- List links for an incidentincidentsListMilestones
- List milestones for an incidentincidentsListRelatedChangeEvents
- List related changes for an incidentincidentsListRoleAssignments
- List role assignments for an incidentincidentsListSimilar
- List similar incidentsincidentsListStatusPages
- List status pages for an incidentincidentsPartialUpdateImpacts
- Update impacts for an incidentincidentsResolve
- Resolve an incidentincidentsSetAlertAsPrimary
- Set an alert as primary for an incidentincidentsUnarchive
- Unarchive an incidentincidentsUpdate
- Update an incidentincidentsUpdateChatMessage
- Update a chat message in an incidentincidentsUpdateEvent
- Update an incident eventincidentsUpdateEventVotes
- Update votes for an incident eventincidentsUpdateImpacts
- Replace all impacts for an incidentincidentsUpdateLink
- Update an external link for an incidentincidentsUpdateMilestonesBulk
- Bulk update milestone timestamps for an incidentincidentsUpdateNote
- Update a note for an incidentincidentsUpdateRelatedChangeEvent
- Update a related change event for an incidentinfrastructuresList
- List catalog entriesintegrationsAwsGetCloudTrailBatch
- Get an AWS CloudTrail batchintegrationsAwsUpdateConnection
- Update an AWS connectionintegrationsCreateConnection
- Create a new integration connectionintegrationsCreateFieldMap
- Create a field mapping for a ticketing projectintegrationsDeleteFieldMap
- Delete a field map for a ticketing projectintegrationsDeletePriority
- Delete a ticketing priorityintegrationsDeleteProjectConfig
- Delete a ticketing project configurationintegrationsDeleteStatuspageConnection
- Delete a Statuspage connectionintegrationsGet
- Get an integrationintegrationsGetAvailableFields
- List available fields for ticket field mappingintegrationsGetFieldMapAvailableFields
- List available fields for field mappingintegrationsGetProjectConfigurationOptions
- List configuration options for a ticketing projectintegrationsGetProjectFieldOptions
- List configuration options for a ticketing project fieldintegrationsGetStatus
- Get an integration statusintegrationsGetStatuspageConnection
- Get a Statuspage connectionintegrationsGetTicket
- Get a ticketintegrationsList
- List all available integrationsintegrationsListCloudtrailBatches
- List AWS CloudTrail batchesintegrationsListConnections
- List integration connectionsintegrationsListEmojiActions
- List Slack emoji actionsintegrationsListProjects
- List ticketing projectsintegrationsRefreshConnection
- Refresh an integration connectionintegrationsSlackDeleteEmojiAction
- Delete a Slack emoji actionintegrationsSlackGetEmojiAction
- Get a Slack emoji actionintegrationsSlackListWorkspaces
- List Slack workspaces for a connectionintegrationsStatuspageListConnections
- List Statuspage connectionsintegrationsStatuspageListPages
- List StatusPage pages for a connectionintegrationsTicketingGetProject
- Get a ticketing projectintegrationsTicketingListTags
- List ticket tagsintegrationsUpdateCloudTrailBatch
- Update an AWS CloudTrail batchintegrationsUpdateConnection
- Update an integration connectionintegrationsUpdateFieldMap
- Update a field mapping configurationintegrationsUpdatePriority
- Update a ticketing priorityintegrationsUpdateTicketingFieldMap
- Update a field map for a ticketing projectmaintenancesCreate
- Create a scheduled maintenance eventmaintenancesDelete
- Delete a scheduled maintenance eventmaintenancesList
- List scheduled maintenance eventsmetricsGetInfrastructure
- Get metrics for a specific catalog entrymetricsReportingCreateMeasurementDefinition
- Create a measurement definitionmetricsReportingCreateSavedSearch
- Create a saved searchmetricsReportingDeleteMeasurementDefinition
- Archive a measurement definitionmetricsReportingGetMeanTime
- Get mean time metrics for incidentsmetricsReportingGetMeasurementDefinition
- Get a measurement definitionmetricsReportingListIncidentMetrics
- List incident metrics and analyticsmetricsReportingListInfrastructureMetrics
- List metrics for all services, environments, functionalities, or customersmetricsReportingListMeasurementDefinitions
- List measurement definitionsmetricsReportingListRetrospectives
- List retrospective metrics for a date rangemetricsReportingListSavedSearches
- List saved searchesmetricsReportingListUserInvolvementMetrics
- List user involvement metricsmetricsReportingUpdateMeasurementDefinition
- Update a measurement definitiononCallSchedulesDelete
- Delete an on-call schedule for a teamprojectConfigurationsCreate
- Create a ticketing project configurationprojectConfigurationsGet
- Get a ticketing project configurationretrospectivesCreateReason
- Create a contributing factor for a retrospective reportretrospectivesCreateReport
- Create a retrospective reportretrospectivesDeleteReason
- Delete a contributing factor from a retrospective reportretrospectivesGetQuestion
- Get a retrospective questionretrospectivesGetReport
- Get a retrospective reportretrospectivesListQuestions
- List retrospective questionsretrospectivesListReportReasons
- List contributing factors for a retrospective reportretrospectivesListReports
- List retrospective reportsretrospectivesPublishReport
- Publish a retrospective reportretrospectivesUpdateField
- Update a retrospective fieldretrospectivesUpdateQuestions
- Update retrospective questionsretrospectivesUpdateReason
- Update a contributing factor in a retrospective reportretrospectivesUpdateReport
- Update a retrospective reportretrospectivesUpdateReportReasonOrder
- Update the order of contributing factors in a retrospective reportrunbooksCreate
- Create a runbookrunbooksCreateExecution
- Create a runbook executionrunbooksDelete
- Delete a runbookrunbooksExecutionsDelete
- Terminate a runbook executionrunbooksGet
- Get a runbookrunbooksGetExecution
- Get a runbook executionrunbooksGetExecutionStepScript
- Get a runbook execution step scriptrunbooksGetExecutionVoteStatus
- Get vote counts for a runbook executionrunbooksGetStepVoteStatus
- Get vote counts for a runbook steprunbooksList
- List runbooksrunbooksListActions
- List runbook actionsrunbooksListAudits
- List runbook auditsrunbooksListExecutions
- List runbook executionsrunbooksListSelectOptions
- List select options for a runbook integration action fieldrunbooksUpdate
- Update a runbookrunbooksUpdateExecutionStep
- Update a runbook execution steprunbooksUpdateExecutionStepScriptState
- Update the script state for a runbook execution steprunbooksUpdateExecutionStepVotes
- Update votes for a runbook execution steprunbooksUpdateExecutionVotes
- Vote on a runbook executionscimCreate
- Create a team via SCIMscimCreateUser
- Create a user via SCIMscimDeleteGroup
- Delete a SCIM groupscimDeleteUser
- Delete a SCIM userscimGetGroup
- Get a SCIM groupscimGetUser
- Get a SCIM userscimListGroups
- List teams via SCIMscimListUsers
- List users via SCIMscimReplaceUser
- Replace a SCIM userscimUpdateGroup
- Update a SCIM groupscimUpdateUser
- Update a SCIM userservicesCatalogsIngest
- Ingest service catalog dataservicesCatalogsRefresh
- Refresh a service catalogservicesCreate
- Create a serviceservicesCreateChecklistResponse
- Create a checklist response for a serviceservicesCreateDependency
- Create a dependency relationship between servicesservicesCreateLinks
- Create multiple services and link them to external servicesservicesDelete
- Delete a serviceservicesDeleteDependency
- Delete a service dependencyservicesDeleteLink
- Delete a service linkservicesGet
- Get a serviceservicesGetAvailableDownstreamDependencies
- List available downstream service dependenciesservicesGetDependency
- Get a service dependencyservicesList
- List servicesservicesListAvailableUpstreamDependencies
- List available upstream service dependenciesservicesListDependencies
- List dependencies for a serviceservicesListForUser
- List services for a user's teamsservicesPatch
- Update a serviceservicesUpdate
- Update a service dependencysignalsCreateEmailTarget
- Create an email target for signalssignalsCreateRule
- Create a signal rule for a teamsignalsCreateWebhookTarget
- Create a webhook target for signalssignalsDebug
- Debug a signalsignalsDeleteEmailTarget
- Delete a signal email targetsignalsDeleteEscalationPolicy
- Delete an escalation policy for a teamsignalsDeleteRule
- Delete a signal rulesignalsDeleteWebhookTarget
- Delete a webhook targetsignalsGetAnalyticsTimeseries
- List timeseries metrics for signal alertssignalsGetEmailTarget
- Get a signal email targetsignalsGetIngestUrl
- Get signal ingestion URLsignalsGetMttxAnalytics
- Get MTTX analytics for signalssignalsGetOnCallSchedule
- Get an on-call schedule for a teamsignalsGetRule
- Get a signal rulesignalsGetWebhookTarget
- Get a webhook targetsignalsListEmailTargets
- List email targets for signalssignalsListEscalationPolicies
- List escalation policies for a teamsignalsListEventSources
- List event sources for signalssignalsListGroupedMetrics
- List grouped signal alert metricssignalsListOnCall
- List on-call schedulessignalsListRules
- List signal rules for a teamsignalsListTransposers
- List signal transposerssignalsListWebhookTargets
- List webhook targets for signalssignalsTeamsGetEscalationPolicy
- Get an escalation policy for a teamsignalsUpdateEmailTarget
- Update a signal email targetsignalsUpdateOnCallSchedule
- Update an on-call schedule for a teamsignalsUpdateRule
- Update a signal rulesignalsUpdateWebhookTarget
- Update a webhook targetslackCreateEmojiAction
- Create a Slack emoji actionslackListUsergroups
- List Slack usergroupsslackUpdateEmojiAction
- Update a Slack emoji actionstatusPagesCreate
- Create a status pagestatusPagesCreateComponentGroup
- Create a component group for a status pagestatusPagesCreateLink
- Create a link for a status pagestatusPagesCreateSubscribers
- Add subscribers to a status pagestatusPagesCreateSubscription
- Create a status page subscriptionstatusPagesDelete
- Delete a status pagestatusPagesDeleteComponentGroup
- Delete a status page component groupstatusPagesDeleteImage
- Delete an image from a status pagestatusPagesDeleteIncident
- Remove a status page from an incidentstatusPagesDeleteLink
- Delete a status page linkstatusPagesDeleteSubscribers
- Remove subscribers from a status pagestatusPagesDeleteSubscription
- Unsubscribe from status page notificationsstatusPagesGet
- Get a status pagestatusPagesList
- List status pagesstatusPagesListSubscribers
- List status page subscribersstatusPagesUpdate
- Update a status pagestatusPagesUpdateComponentGroup
- Update a status page component groupstatusPagesUpdateImage
- Upload an image for a status pagestatusPagesUpdateLink
- Update a status page linkstatuspageUpdateConnection
- Update a Statuspage connectionstatusUpdateTemplatesCreate
- Create a status update templatesystemPing
- Check API connectivitytasksConvertToFollowup
- Convert a task to a follow-uptasksCreate
- Create a task for an incidenttasksCreateChecklistTemplate
- Create a checklist templatetasksCreateList
- Create a task listtasksDelete
- Delete a task from an incidenttasksDeleteChecklistTemplate
- Archive a checklist templatetasksGet
- Get a task listtasksGetForIncident
- Get a task for an incidenttasksListChecklistTemplates
- List checklist templatestasksListDelete
- Delete a task listtasksListForIncident
- List tasks for an incidenttasksListTasks
- List task liststasksUpdate
- Update a task listtasksUpdateChecklistTemplate
- Update a checklist templatetasksUpdateTask
- Update a task for an incidentteamsArchive
- Archive a teamteamsCreate
- Create a teamteamsCreateEscalationPolicy
- Create an escalation policy for a teamteamsCreateOnCallSchedule
- Create an on-call schedule for a teamteamsCreateShift
- Create a shift for an on-call scheduleteamsDeleteScheduleShift
- Delete an on-call shift from a team scheduleteamsGet
- Get a teamteamsGetScheduleShift
- Get an on-call shift for a team scheduleteamsList
- List teamsteamsListOnCallSchedules
- List on-call schedules for a teamteamsListSchedules
- List schedulesteamsUpdate
- Update a teamteamsUpdateEscalationPolicy
- Update an escalation policy for a teamteamsUpdateScheduleShift
- Update an on-call shift in a team scheduleticketingGetFieldMap
- Get a field map for a ticketing projectticketingPrioritiesGet
- Get a ticketing priorityticketingUpdateProjectConfig
- Update a ticketing project configurationticketsCreate
- Create a ticketticketsDelete
- Delete a ticketticketsList
- List ticketsticketsUpdate
- Update a ticketusersGet
- Get a userusersGetCurrent
- Get the currently authenticated userusersList
- List userswebhooksCreate
- Create a webhookwebhooksDelete
- Delete a webhookwebhooksGet
- Get a webhookwebhooksList
- List webhookswebhooksListDeliveries
- List webhook deliverieswebhooksUpdate
- Update a webhookzendeskSearchTickets
- Search for Zendesk tickets
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
Tip
Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
- Node.js v20+: Since v20, Node.js comes with a native
openAsBlob
function innode:fs
. - Bun: The native
Bun.file
function produces a file handle that can be used for streaming file uploads. - Browsers: All supported browsers return an instance to a
File
when reading the value from an<input type="file">
element. - Node.js v18: A file stream can be created using the
fileFrom
helper fromfetch-blob/from.js
.
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
import { openAsBlob } from "node:fs";
const firehydrantTypescriptSDK = new FirehydrantTypescriptSDK({
apiKey: process.env["FIREHYDRANTTYPESCRIPTSDK_API_KEY"] ?? "",
});
async function run() {
const result = await firehydrantTypescriptSDK.incidents.createAttachment({
incidentId: "<id>",
requestBody: {
file: await openAsBlob("example.file"),
},
});
// Handle the result
console.log(result);
}
run();
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
const firehydrantTypescriptSDK = new FirehydrantTypescriptSDK({
apiKey: process.env["FIREHYDRANTTYPESCRIPTSDK_API_KEY"] ?? "",
});
async function run() {
const result = await firehydrantTypescriptSDK.accountSettings
.getAiPreferences({
retries: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});
// Handle the result
console.log(result);
}
run();
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
const firehydrantTypescriptSDK = new FirehydrantTypescriptSDK({
retryConfig: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
apiKey: process.env["FIREHYDRANTTYPESCRIPTSDK_API_KEY"] ?? "",
});
async function run() {
const result = await firehydrantTypescriptSDK.accountSettings
.getAiPreferences();
// Handle the result
console.log(result);
}
run();
Some methods specify known errors which can be thrown. All the known errors are enumerated in the models/errors/errors.ts
module. The known errors for a method are documented under the Errors tables in SDK docs. For example, the getAiPreferences
method may throw the following errors:
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400, 413, 414, 415, 422, 431, 510 | application/json |
errors.Unauthorized | 401, 403, 407, 511 | application/json |
errors.NotFound | 404, 501, 505 | application/json |
errors.Timeout | 408, 504 | application/json |
errors.RateLimited | 429 | application/json |
errors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json |
errors.APIError | 4XX, 5XX | */* |
If the method throws an error and it is not captured by the known errors, it will default to throwing a APIError
.
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
import {
BadRequest,
InternalServerError,
NotFound,
RateLimited,
SDKValidationError,
Timeout,
Unauthorized,
} from "firehydrant-typescript-sdk/models/errors";
const firehydrantTypescriptSDK = new FirehydrantTypescriptSDK({
apiKey: process.env["FIREHYDRANTTYPESCRIPTSDK_API_KEY"] ?? "",
});
async function run() {
let result;
try {
result = await firehydrantTypescriptSDK.accountSettings.getAiPreferences();
// Handle the result
console.log(result);
} catch (err) {
switch (true) {
// The server response does not match the expected SDK schema
case (err instanceof SDKValidationError): {
// Pretty-print will provide a human-readable multi-line error message
console.error(err.pretty());
// Raw value may also be inspected
console.error(err.rawValue);
return;
}
case (err instanceof BadRequest): {
// Handle err.data$: BadRequestData
console.error(err);
return;
}
case (err instanceof Unauthorized): {
// Handle err.data$: UnauthorizedData
console.error(err);
return;
}
case (err instanceof NotFound): {
// Handle err.data$: NotFoundData
console.error(err);
return;
}
case (err instanceof Timeout): {
// Handle err.data$: TimeoutData
console.error(err);
return;
}
case (err instanceof RateLimited): {
// Handle err.data$: RateLimitedData
console.error(err);
return;
}
case (err instanceof InternalServerError): {
// Handle err.data$: InternalServerErrorData
console.error(err);
return;
}
default: {
// Other errors such as network errors, see HTTPClientErrors for more details
throw err;
}
}
}
}
run();
Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The SDKValidationError
that is thrown as a result will capture the raw value that failed validation in an attribute called rawValue
. Additionally, a pretty()
method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging.
In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the models/errors/httpclienterrors.ts
module:
HTTP Client Error | Description |
---|---|
RequestAbortedError | HTTP request was aborted by the client |
RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
ConnectionError | HTTP client was unable to make a request to a server |
InvalidRequestError | Any input used to create a request is invalid |
UnexpectedClientError | Unrecognised or unexpected error |
The default server can also be overridden globally by passing a URL to the serverURL: string
optional parameter when initializing the SDK client instance. For example:
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
const firehydrantTypescriptSDK = new FirehydrantTypescriptSDK({
serverURL: "https://api.firehydrant.io/",
apiKey: process.env["FIREHYDRANTTYPESCRIPTSDK_API_KEY"] ?? "",
});
async function run() {
const result = await firehydrantTypescriptSDK.accountSettings
.getAiPreferences();
// Handle the result
console.log(result);
}
run();
The TypeScript SDK makes API calls using an HTTPClient
that wraps the native
Fetch API. This
client is a thin wrapper around fetch
and provides the ability to attach hooks
around the request lifecycle that can be used to modify the request or handle
errors and response.
The HTTPClient
constructor takes an optional fetcher
argument that can be
used to integrate a third-party HTTP client or when writing tests to mock out
the HTTP client and feed in fixtures.
The following example shows how to use the "beforeRequest"
hook to to add a
custom header and a timeout to requests and how to use the "requestError"
hook
to log errors:
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
import { HTTPClient } from "firehydrant-typescript-sdk/lib/http";
const httpClient = new HTTPClient({
// fetcher takes a function that has the same signature as native `fetch`.
fetcher: (request) => {
return fetch(request);
}
});
httpClient.addHook("beforeRequest", (request) => {
const nextRequest = new Request(request, {
signal: request.signal || AbortSignal.timeout(5000)
});
nextRequest.headers.set("x-custom-header", "custom value");
return nextRequest;
});
httpClient.addHook("requestError", (error, request) => {
console.group("Request Error");
console.log("Reason:", `${error}`);
console.log("Endpoint:", `${request.method} ${request.url}`);
console.groupEnd();
});
const sdk = new FirehydrantTypescriptSDK({ httpClient });
You can setup your SDK to emit debug logs for SDK requests and responses.
You can pass a logger that matches console
's interface as an SDK option.
Warning
Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
import { FirehydrantTypescriptSDK } from "firehydrant-typescript-sdk";
const sdk = new FirehydrantTypescriptSDK({ debugLogger: console });
You can also enable a default debug logger by setting an environment variable FIREHYDRANTTYPESCRIPTSDK_DEBUG
to true.
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.