Skip to content

createSentryClient

createSentryClient(opts): object

Defined in: index.ts:21

Create a Sentry client with auth, projects, sentryApps and workflows groups, all sharing one REST client built from opts.

SentryClientOptions

object

auth: object

getOrg: (org) => Promise<SentryOrganization>

Get a single organization by slug.

string

Promise<SentryOrganization>

organizations: () => Promise<SentryOrganization[]>

List all organizations accessible with the current token.

Promise<SentryOrganization[]>

projects: object

create: (org, team, input) => Promise<SentryProject>

Create a project under a team. Returns the new project. Team slug defaults to org slug when omitted by the caller.

string

string

CreateSentryProjectInput

Promise<SentryProject>

get: (org, slug) => Promise<SentryProject>

Get a single project by slug. Throws ProviderApiError 404 if not found.

string

string

Promise<SentryProject>

keys: (org, slug) => Promise<SentryKey[]>

List client keys (DSNs) for a project.

string

string

Promise<SentryKey[]>

list: (org) => Promise<SentryProject[]>

List all projects in an org.

string

Promise<SentryProject[]>

sentryApps: object

create: (org, input) => Promise<SentryApp>

Create an internal integration. It is installed on the organization at once.

string

SentryAppInput

Promise<SentryApp>

get: (slug) => Promise<SentryApp>

One integration by slug or id.

string

Promise<SentryApp>

installations: (org) => Promise<SentryAppInstallation[]>

The integrations installed on an organization, with the numeric app id that alert actions point at.

string

Promise<SentryAppInstallation[]>

list: (org) => Promise<SentryApp[]>

The custom integrations an organization has made.

string

Promise<SentryApp[]>

update: (slug, input) => Promise<SentryApp>

Update an integration (Sentry requires name and scopes on every update, and may reset a setting a PUT leaves out). A setting not given keeps its current value: it is read first, only when one is missing.

string

SentryAppInput

Promise<SentryApp>

workflows: object

create: (org, input) => Promise<SentryWorkflow>

string

SentryWorkflowInput

Promise<SentryWorkflow>

delete: (org, id) => Promise<void>

Remove a workflow. Sentry answers 204 with no body.

string

string

Promise<void>

detectors: (org) => Promise<SentryDetector[]>

The detectors of an organization: what a workflow is attached to.

string

Promise<SentryDetector[]>

get: (org, id) => Promise<SentryWorkflow>

string

string

Promise<SentryWorkflow>

list: (org) => Promise<SentryWorkflow[]>

The alert rules (workflows) of an organization.

string

Promise<SentryWorkflow[]>

update: (org, id, input) => Promise<SentryWorkflow>

Replace a workflow with the given body. Sentry offers no version or ETag to make this conditional, so a concurrent edit is overwritten: read, change and write back without another writer in between.

string

string

SentryWorkflowInput

Promise<SentryWorkflow>