Outpost Quickstart

Clone the Outpost repo:

git clone https://github.com/hookdeck/outpost.git
sh

Navigate to outpost/examples/docker-compose/:

cd outpost/examples/docker-compose/
sh

Create a .env file from the top-level example file:

cp ../../.env.example .env
sh

Update the API_KEY value within the new .env file.

There are two options to run Outpost locally for this quickstart. Choose one of the following:

  1. With RabbitMQ:
    docker-compose -f compose.yml -f compose-rabbitmq.yml up
    sh
  2. With SQS via LocalStack:
    docker-compose -f compose.yml -f compose-awssqs.yml up
    sh

Check the services are running:

curl localhost:3333/api/v1/healthz
sh

Wait until you get a OK% response.

Create a tenant with the following command, replacing <TENANT_ID> with a unique identifier such as "your_org_name", and the <API_KEY> with the value you set in your .env:

curl --location --request PUT 'localhost:3333/api/v1/<TENANT_ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>'
sh

Run a local server exposed via a localtunnel or use a hosted service such as the Hookdeck Console to capture webhook events.

Create a webhook destination where events will be delivered to with the following command. Again, replace <TENANT_ID> and <API_KEY>. Also, replace <URL> with the webhook destinations URL:

curl --location 'localhost:3333/api/v1/<TENANT_ID>/destinations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>' \
--data '{
    "type": "webhook",
    "topics": ["*"],
    "config": {
        "url": "<URL>"
    }
}'
sh

Publish an event, remembering to replace <API_KEY> and <TENANT_ID>:

curl --location 'localhost:3333/api/v1/publish' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>' \
--data '{
    "tenant_id": "<TENANT_ID>",
    "topic": "user.created",
    "eligible_for_retry": true,
    "metadata": {
        "meta": "data"
    },
    "data": {
        "user_id": "userid"
    }
}'
sh

Check the logs on your server or your webhook capture tool for the delivered event.