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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”object
auth:
object
auth.getOrg
Section titled “auth.getOrg”getOrg: (
org) =>Promise<SentryOrganization>
Get a single organization by slug.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryOrganization>
auth.organizations
Section titled “auth.organizations”organizations: () =>
Promise<SentryOrganization[]>
List all organizations accessible with the current token.
Returns
Section titled “Returns”Promise<SentryOrganization[]>
projects
Section titled “projects”projects:
object
projects.create
Section titled “projects.create”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.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<SentryProject>
projects.get
Section titled “projects.get”get: (
org,slug) =>Promise<SentryProject>
Get a single project by slug. Throws ProviderApiError 404 if not found.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<SentryProject>
projects.keys
Section titled “projects.keys”keys: (
org,slug) =>Promise<SentryKey[]>
List client keys (DSNs) for a project.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<SentryKey[]>
projects.list
Section titled “projects.list”list: (
org) =>Promise<SentryProject[]>
List all projects in an org.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryProject[]>
sentryApps
Section titled “sentryApps”sentryApps:
object
sentryApps.create
Section titled “sentryApps.create”create: (
org,input) =>Promise<SentryApp>
Create an internal integration. It is installed on the organization at once.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryApp>
sentryApps.get
Section titled “sentryApps.get”get: (
slug) =>Promise<SentryApp>
One integration by slug or id.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryApp>
sentryApps.installations
Section titled “sentryApps.installations”installations: (
org) =>Promise<SentryAppInstallation[]>
The integrations installed on an organization, with the numeric app id that alert actions point at.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryAppInstallation[]>
sentryApps.list
Section titled “sentryApps.list”list: (
org) =>Promise<SentryApp[]>
The custom integrations an organization has made.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryApp[]>
sentryApps.update
Section titled “sentryApps.update”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryApp>
workflows
Section titled “workflows”workflows:
object
workflows.create
Section titled “workflows.create”create: (
org,input) =>Promise<SentryWorkflow>
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryWorkflow>
workflows.delete
Section titled “workflows.delete”delete: (
org,id) =>Promise<void>
Remove a workflow. Sentry answers 204 with no body.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<void>
workflows.detectors
Section titled “workflows.detectors”detectors: (
org) =>Promise<SentryDetector[]>
The detectors of an organization: what a workflow is attached to.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryDetector[]>
workflows.get
Section titled “workflows.get”get: (
org,id) =>Promise<SentryWorkflow>
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<SentryWorkflow>
workflows.list
Section titled “workflows.list”list: (
org) =>Promise<SentryWorkflow[]>
The alert rules (workflows) of an organization.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SentryWorkflow[]>
workflows.update
Section titled “workflows.update”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.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<SentryWorkflow>