Background
A target is an integration that reads data and writes it to some target system. For example, hotglue supports targets for:- Uploading files to storage systems S3, Azure Blob Storage, or SFTP servers.
- Creating and Updating invoices in ERPs like Netsuite, Sage Intacct, and Dynamics BC
- Upserting records into databases like Postgres, Snowflake, and BigQuery
Setting up a local target environment
Virtual Environments
Dependencies can differ from target to target, so it is best to use a virtual environment to isolate the target’s Python dependencies. You can create a virtual environment named.venv in your target workspace with:
| Dependency File | Command |
|---|---|
requirements.txt | pip install -r requirements.txt |
setup.py | pip install -e . |
pyproject.toml | pip install -e . |
Config
Targets require a valid config, which will include fields like API keys, OAuth credentials, and configuration flags. For example:💡 To keep your workspace clean, create a.secretsfolder to store yourconfig.json. Run all tap commands out of this folder to make sure your catalogs and output data stay separate from relevant code.
Data
If you want to try to reproduce the behavior of a particular hotglue job, you can download the job folder on your hotglue job page:
data.singer file with all your data:
data.singer somewhere accessible by your target. We recommend placing it in a git-ignored .secrets with your config.json to avoid accidently committing it.
Running a target
You can now pipe your data into the target. If your target is namedtarget-salesforce, you would run:
target-state.json.
If you attempted to send two contacts to Salesforce, your target state might look something like this:
id is the id in Salesforce and externalId (if passed on the record) is the id in the source system.
If you prefer to work with VSCode’s Debugger, you can run the target with the following configuration: