
Sf Datacloud Prepare
Prepare Salesforce Data Cloud Ingestion API connectivity—credentials, connector, and schema prerequisites—before running send-data examples.
Overview
sf-datacloud-prepare is an agent skill for the Build phase that documents Salesforce Data Cloud Ingestion API prepare steps including connector, schema, and credential setup before sending data.
Install
npx skills add https://github.com/jaganpro/sf-skills --skill sf-datacloud-prepareWhat is this skill?
- Documents env vars: CONSUMER_KEY, CONSUMER_SECRET, SF_USERNAME, SF_LOGIN_URL, TENANT_URL, PRIVATE_KEY_FILE, CONNECTOR_NA
- Prerequisites: create Ingestion API connector, schema-upsert via `sf data360 connection schema-upsert`, optional UI data
- Points to public-safe ingest-api-connection.json and ingest-api-schema.json examples in sf-datacloud-connect
- Part of the sf-datacloud-* skill family with shared CREDITS and UPSTREAM maintenance docs
- Minimal folder example for sending records through Ingestion API after prepare completes
Adoption & trust: 868 installs on skills.sh; 418 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want to ingest records into Salesforce Data Cloud but lack the ordered prepare steps for connectors, schema upsert, and authentication env vars before running send-data.
Who is it for?
Indie SaaS builders and integrators wiring badge scans, product events, or CRM-adjacent feeds into Data Cloud with JWT-based server auth.
Skip if: Teams not on Salesforce Data Cloud, pure Marketing Cloud-only stacks, or ingest flows that skip Ingestion API connectors entirely.
When should I use this skill?
User is setting up Salesforce Data Cloud Ingestion API connect/prepare steps before sending records (connector, schema-upsert, env vars, optional data stream).
What do I get? / Deliverables
Your org has connector and schema prerequisites aligned with the example env template so Ingestion API send-data can run against the named connector and object.
- Configured connector and schema prerequisites per example JSON paths
- Documented .env-style variable set for ingest scripts
- Ready state to run Ingestion API send-data example
Recommended Skills
Journey fit
Data Cloud prepare steps happen while integrating customer data into Salesforce during product build, before downstream ingest and validation in production pipelines. Connector creation, schema upsert, and env vars are integration setup against Salesforce Data Cloud APIs, not frontend or launch work.
How it compares
Prepare-and-connect documentation for Salesforce Data Cloud ingest, not a generic REST CRUD generator or MCP database bridge.
Common Questions / FAQ
Who is sf-datacloud-prepare for?
Developers using Salesforce Data Cloud who need agent-guided setup for Ingestion API connectors, schema upsert, and environment variables before executing ingest examples.
When should I use sf-datacloud-prepare?
Use during Build integrations when you are creating an Ingestion API connector, uploading schema with sf data360 commands, and configuring CONSUMER_KEY, TENANT_URL, and PRIVATE_KEY_FILE before send-data.py or equivalent sends.
Is sf-datacloud-prepare safe to install?
It references secrets and private keys for Salesforce JWT flows; review the Security Audits panel on this page and store credentials outside the repo with least-privilege external client apps.
SKILL.md
READMESKILL.md - Sf Datacloud Prepare
# Credits & Acknowledgments Primary contributor: **Gnanasekaran Thoppae** This skill is part of the `sf-datacloud-*` family. Shared attribution, upstream source mapping, and maintenance notes live in: - [../sf-datacloud/CREDITS.md](../sf-datacloud/CREDITS.md) - [../sf-datacloud/UPSTREAM.md](../sf-datacloud/UPSTREAM.md) CONSUMER_KEY=<your consumer key from External Client App> CONSUMER_SECRET=<your consumer secret> SF_USERNAME=<your salesforce username> SF_LOGIN_URL=https://login.salesforce.com TENANT_URL=https://<tenant-id>.c360a.salesforce.com PRIVATE_KEY_FILE=/path/to/server.key CONNECTOR_NAME=Badge_Scanner OBJECT_NAME=Badge_Scan # Ingestion API example This folder contains a minimal, public-safe example for sending records into Salesforce Data Cloud through the Ingestion API. ## What this example assumes Before running `send-data.py`, complete the connect/prepare setup steps: 1. create an Ingestion API connector 2. upload the schema with `sf data360 connection schema-upsert` 3. create the corresponding data stream in the UI if your org requires that step Related connector definitions live in: - [../../../sf-datacloud-connect/examples/connections/ingest-api-connection.json](../../../sf-datacloud-connect/examples/connections/ingest-api-connection.json) - [../../../sf-datacloud-connect/examples/connections/ingest-api-schema.json](../../../sf-datacloud-connect/examples/connections/ingest-api-schema.json) ## Prerequisites ```bash pip install PyJWT cryptography requests ``` ## Setup ```bash cd skills/sf-datacloud-prepare/examples/ingestion-api cp .env.example .env # edit .env with your values python3 send-data.py ``` ## Environment variables - `CONSUMER_KEY` — external client app consumer key - `CONSUMER_SECRET` — external client app consumer secret if your auth flow needs it - `SF_USERNAME` — Salesforce username used for JWT auth - `SF_LOGIN_URL` — login host such as `https://login.salesforce.com` - `TENANT_URL` — Data Cloud tenant URL such as `https://<tenant>.c360a.salesforce.com` - `PRIVATE_KEY_FILE` — path to the JWT private key - `CONNECTOR_NAME` — Ingestion API connector name - `OBJECT_NAME` — uploaded schema object name ## Notes - auth is a staged flow: JWT → Salesforce token → Data Cloud token - the ingestion endpoint uses the Data Cloud tenant URL, not the Salesforce instance URL - `202` means the payload was accepted for processing - validation failures often appear in the Problem Records DLO family #!/usr/bin/env python3 """ Send data to Data Cloud through the Ingestion API. Prerequisites: pip install PyJWT cryptography requests Usage: 1. Copy .env.example to .env and fill in your values 2. python3 send-data.py See README.md in this folder for setup notes. """ from __future__ import annotations import os import time import uuid from datetime import datetime, timezone from pathlib import Path import jwt import requests def load_env_file() -> None: env_file = Path(__file__).parent / ".env" if not env_file.exists(): return for line in env_file.read_text().splitlines(): if "=" in line and not line.startswith("#"): key, val = line.split("=", 1) os.environ.setdefault(key.strip(), val.strip()) load_env_file() CONSUMER_KEY = os.environ["CONSUMER_KEY"] SF_USERNAME = os.environ["SF_USERNAME"] SF_LOGIN_URL = os.environ.get("SF_LOGIN_URL", "https://login.salesforce.com") TENANT_URL = os.environ["TENANT_URL"] PRIVATE_KEY_FILE = os.environ["PRIVATE_KEY_FILE"] CONNECTOR_NAME = os.environ["CONNECTOR_NAME"] OBJECT_NAME = os.environ["OBJECT_NAME"] def get_cdp_token() -> str: """Authenticate: JWT -> Salesforce access token -> Data Cloud token.""" private_key = Path(PRIVATE_KEY_FILE).read_text() claim = { "iss": CONSUMER_KEY, "sub": SF_USERNAME, "aud": SF_LOGIN_URL, "exp": int(time.time()) + 300, } assertion = jwt.encode(claim, private_key, algorithm="RS256") token_data = requests.post(