Files
Eric Allam c0dfa8048a feat: BYO Auth (#491)
* feat: BYO Auth

Define client-side auth resolvers to be able to supply custom authentication credentials for integrations before a run is performed

- Added new defineAuthResolver
- Update all integrations to support the new auth resolvers
- Strip internal symbols from .d.ts in integrations and trigger-sdk
- Added BYO Auth docs
- Update Dynamic Schedule to support associated account IDs
- Create external accounts just-in-time
- Added Account ID field to test job when there are external auth integrations
- Show Account ID on run dashboard
- Added new Run error state called “Unresolved auth”

* Added changeset

* Remove @internal from TriggerIntegration public methods

* Add void to the result union

* DynamicTriggers now work with the new BYO auth system, and added a bunch of docs and docs changes

* Add additional key material for registering dynamic trigger task

* Add new define* instance methods to the overview
2023-09-22 08:54:31 -07:00

43 lines
1.3 KiB
Plaintext

---
title: "DynamicTrigger: Constructor"
sidebarTitle: "Constructor"
description: "The `DynamicTrigger()` constructor creates a new [DynamicTrigger](/sdk/dynamictrigger/overview) instance."
---
## Parameters
<ResponseField name="client" type="TriggerClient" required>
The `TriggerClient` instance to use for registering the trigger.
</ResponseField>
<ResponseField name="options" type="DynamicTriggerOptions" required>
The options for the dynamic trigger.
<Expandable title="options" defaultOpen>
<ResponseField name="id" type="string" required>
Used to uniquely identify a DynamicTrigger
</ResponseField>
<ResponseField name="event" type="event" required>
An event from an [Integration](/integrations) package that you want to attach to the
DynamicTrigger. The event types will come through to the payload in your Job's run.
</ResponseField>
<ResponseField name="source" type="source" required>
An external source fron an [Integration](/integrations) package
</ResponseField>
</Expandable>
</ResponseField>
## Returns
<ResponseField name="DynamicTrigger instance" type="DynamicTrigger" />
<RequestExample>
```typescript
const dynamicOnIssueOpenedTrigger = new DynamicTrigger(client, {
id: "github-issue-opened",
event: events.onIssueOpened,
source: github.sources.repo,
});
```
</RequestExample>