---
title: Configure your first sync
description: Build and validate isolated Google Ads and Meta Ads connection definitions.
---

This tutorial is for a developer composing the public package into an operator-owned Cloudflare deployment. You will create typed desired state and turn it into validated connection definitions without putting credential values in source.

## define desired state

```ts
const config = defineAdsSyncConfig({
  connections: [
    {
      catalog: googleCatalog,
      connectionId: "google_ads_performance",
      destinationSchema: "airbyte_google_ads_performance",
      provider: "google_ads",
      selectedStreams: ["campaign_daily_performance"],
      sourceConfigSecret: "GOOGLE_ADS_SOURCE_CONFIG_JSON",
      streamGroup: "performance",
    },
  ],
});
```

Use one `destinationSchema` for each enabled Sync Connection. This isolates Airbyte Direct Load tables and generation state across accounts and catalogs.

## resolve the secret at the deployment boundary

Load the named secret in your Worker or operator process. Pass its parsed provider configuration to `syncConnectionDefinitionFromConfig()`. The package uses the value to derive non-secret identity and fingerprints; the desired-state config keeps only the secret name.

```ts
const connection = await syncConnectionDefinitionFromConfig(
  config.connections[0],
  parsedSourceSecret
);
```

Do not log or commit `parsedSourceSecret`.

## validate the connection set

```ts
validateDestinationSchemaIsolation(connections);
```

The validator throws when two enabled connections claim the same Airbyte schema. Treat that as a configuration error and choose distinct schemas before a run.

## run the complete tutorial

The public source tutorial defines Google Ads, Meta performance, and Meta metadata connections, resolves placeholder source identities, and validates schema isolation:

```bash
pnpm --filter @patronage/ads-sync build
node --experimental-strip-types packages/ads-sync/src/tutorials/configure-connections.ts
```

Read and run [`configure-connections.ts`](https://github.com/patronage/agentic-marketing-connectors/blob/main/packages/ads-sync/src/tutorials/configure-connections.ts). Continue with [verify a bounded run](/how-to/verify-a-bounded-run) before adapting a reference deployment to real data.
