Skip to content

Commit

Permalink
add env
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPonchia committed Dec 20, 2024
1 parent 7d8eeef commit 62a6f6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/active-campaign-client/src/scripts/sync_all_users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { ActiveCampaignClient } from '../clients/activeCampaignClient';
import { CognitoIdentityServiceProvider } from 'aws-sdk';
import { DynamoDBClient, QueryCommand } from '@aws-sdk/client-dynamodb';
import { ContactPayload } from '../types/contactPayload';
import * as dotenv from 'dotenv';

const activeCampaignClient = new ActiveCampaignClient(
process.env.TEST_AC_BASE_URL,
process.env.TEST_AC_API_KEY
);

const userPoolId = process.env.COGNITO_USER_POOL_ID!;
const userPoolId = () => process.env.COGNITO_USER_POOL_ID!;

// Initialize Cognito client
const cognito = new CognitoIdentityServiceProvider({
Expand Down Expand Up @@ -48,7 +49,7 @@ async function listAllUsers() {

do {
const params: any = {
UserPoolId: userPoolId,
UserPoolId: userPoolId(),
PaginationToken: paginationToken,
};

Expand All @@ -67,6 +68,8 @@ async function listAllUsers() {
}

async function main() {
dotenv.config();
console.log(process.env);
const users = await listAllUsers();

console.log(process.env.DYNAMO_WEBINARS_TABLE_NAME);
Expand Down

0 comments on commit 62a6f6b

Please sign in to comment.