tap-userflow
is a Singer tap for UserFlow.
Built with the Meltano Tap SDK for Singer Taps.
Install from PyPi:
pip install kingalban-tap-userflow
Install from GitHub:
pipx install git+https://github.com/kingalban/tap-userflow.git@main
A full list of supported settings and capabilities for this tap is available by running:
tap-userflow --about
{
"auth_token": "<userflow-api-key>"
}
This Singer tap will automatically import any environment variables within the working directory's
.env
if the --config=ENV
is provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the .env
file.
Userflow uses Bearer authentication. Follow their documentation here to generate API keys.
You can easily run tap-userflow
by itself or in a pipeline using Meltano.
tap-userflow --version
tap-userflow --help
tap-userflow --config CONFIG --discover > ./catalog.json
Userflow may hard delete content_sessions
which can result in a state
which can't be automatically recovered.
Example situation:
- A
content_session
is ingested and it's ID is recorded as the latest state for that partition. - Later that
content_session
is deleted. - When
tap-userflow
tries to request the nextcontent_session
s for that partition is will make a request tohttps://api.userflow.com/content_versions?content_id=<content_id>?starting_after=<deleted_session_id>&...
- Userflow API will respond with
400 Client Error: Bad Request for path: /content_sessions (code=\'invalid_params\'
starting_after: Content session with id \'139ba1bd-ffe4-433e-8004-1fcf7556b75e\' not found
Automatically recovering from this situation safely is tricky, so manually editing the state is necessary.
You can do this by either removing the relevant partition from the state (causing a complete re-sync of the partition),
or by changing the replication_key_value
to an earlier known good content_session
id.
Note: The deleted content_session
will remain wherever you delivered it to (your analytics database).
If you have GDPR concerns about this, you should also manually remove it.
Follow these instructions to contribute to this project.
pipx install poetry
poetry install
Create tests within the tests
subfolder and
then run:
TAP_USERFLOW_AUTH_TOKEN='<your-token-here>' poetry run pytest
You can also test the tap-userflow
CLI interface directly using poetry run
:
poetry run tap-userflow --help
Testing with Meltano
Note: This tap will work in any Singer environment and does not require Meltano. Examples here are for convenience and to streamline end-to-end orchestration scenarios.
Next, install Meltano (if you haven't already) and any needed plugins:
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-userflow
meltano install
Now you can test and orchestrate using Meltano:
# Test invocation:
meltano invoke tap-userflow --version
# OR run a test `elt` pipeline:
meltano elt tap-userflow target-jsonl
See the dev guide for more instructions on how to use the SDK to develop your own taps and targets.