Skip to content

Commit

Permalink
feat: expose environment name in scripts (#2268)
Browse files Browse the repository at this point in the history
Customer wants to have access to the environment name from within their
custom scripts. See linear ticket for more info.

## Issue ticket number and link
https://linear.app/nango/issue/NAN-967/surface-env-name-in-scripts

## Checklist before requesting a review (skip if just adding/editing
APIs & templates)
- [ ] I added tests, otherwise the reason is: 
- [ ] I added observability, otherwise the reason is:
- [ ] I added analytics, otherwise the reason is:
  • Loading branch information
TBonnin authored Jun 5, 2024
1 parent ad420f8 commit 186f44c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/shared/lib/sdk/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export interface NangoProps {
accountId?: number;
connectionId: string;
environmentId?: number;
environmentName?: string;
activityLogId?: number | undefined;
providerConfigKey: string;
provider?: string;
Expand Down Expand Up @@ -292,6 +293,7 @@ export class NangoAction {
syncId?: string;
nangoConnectionId?: number;
environmentId?: number;
environmentName?: string;
syncJobId?: number;
dryRun?: boolean;
abortSignal?: AbortSignal;
Expand Down Expand Up @@ -348,6 +350,10 @@ export class NangoAction {
this.environmentId = config.environmentId;
}

if (config.environmentName) {
this.environmentName = config.environmentName;
}

if (config.provider) {
this.provider = config.provider;
}
Expand Down
1 change: 1 addition & 0 deletions packages/shared/lib/services/sync/run.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ export default class SyncRun {
accountId: this.account?.id as number,
connectionId: String(this.nangoConnection.connection_id),
environmentId: this.nangoConnection.environment_id,
environmentName: this.environment?.name as string,
providerConfigKey: String(this.nangoConnection.provider_config_key),
provider: this.provider as string,
activityLogId: this.activityLogId,
Expand Down

0 comments on commit 186f44c

Please sign in to comment.