Configuration
Every field of HelpdeskConfig, the object buildHelpdesk takes, with its type and default.
HelpdeskConfig is the one object that buildHelpdesk(config) from better-helpdesk takes. The fields below are grouped by what they serve; the order inside the type is different. Inboxes have a page of their own, and the adapter interfaces are on Adapters.
import { buildHelpdesk, postgresAdapter } from 'better-helpdesk';
import { pool } from './db'; // a pg.Pool
export const helpdesk = buildHelpdesk({
db: postgresAdapter({ pool }),
referencePrefix: 'ACME',
adminUrl: 'https://app.example.com/helpdesk/',
inboxes: { support: {} },
identify: async () => null,
});Required
Prop
Type
Routing and identity
Prop
Type
Names shown to customers
Prop
Type
Conversations
Prop
Type
Service levels and tiers
Prop
Type
Prop
Type
Adapters and host hooks
Prop
Type
CRM
Prop
Type
Rate limits
Prop
Type
Fixed limits that are not configurable are listed under HTTP routes.
Startup checks
buildHelpdesk throws when:
identityTokenSecretis set and shorter than 32 bytes.- An inbox's
hoursfails validation; the message names the inbox. The rules are on Inboxes. slafails validation: a target withoutrespondorresolve, a target that is not a positive number of hours,warnAtoutside 0 to 1, or hours that break the rules above.prioritiesis empty, repeats a word, or has one longer than 50 characters; or an inbox'sdefaultPriorityorpriorities.options,priorityLabelsor an SLA target names a priority that is not in the list.
Identity
What identify returns. Identity, HelpdeskUser and HelpdeskOrg are exported as types.
Prop
Type
HelpdeskUser
Prop
Type
HelpdeskOrg
Prop
Type
SlaConfig
The value of sla. SlaConfig, SlaPolicy, SlaTarget and Priority are exported as types.
Prop
Type
SlaPolicy
Prop
Type
SlaTarget
Prop
Type
A target needs respond, resolve or reply, each a positive number of hours or a whole number of days from '1d' to '999d'. A day target is due at the same time that many open days later; In business days has the rules.
sla: {
tiers: {
gold: {
hours: 'always',
targets: {
urgent: { respond: 4, resolve: 24 },
high: { respond: 8, resolve: 48 },
normal: { respond: 16, resolve: 80, hours: office },
},
},
},
default: { targets: { normal: { respond: 24 } } },
warnAt: 0.75,
},TierInput
What resolveTier receives. Exported as a type.
Prop
Type
CustomFieldDef
Prop
Type
A value may also be null. A key that is not defined for the record is refused with 400.
Link types
The arguments and result of links. All three are exported as types.
LinkContact
Prop
Type
LinkCompany
Prop
Type
HostLink
Prop
Type
Translated
Copy you write per language: { en: string } & Partial<Record<Locale, string>>. English is required, and a language you leave out shows the English text, so adding a language to the package never breaks your build. The qualifying question's labels and CustomFieldDef use it.
Fixed values
These are not configurable and not exported.
| Name | Values |
|---|---|
| Locales | en, de, fr, it |
| Statuses | open, pending, resolved |
| Channels | widget, email, agent, api |
| Roles | agent, supervisor, viewer |