### Install Convoy Client (Golang) Source: https://www.getconvoy.io/docs/guides/sending-webhook-example Installs the convoy-go SDK using the go get command. This is necessary to use Convoy functionalities within your Golang applications. ```bash go get github.com/frain-dev/convoy-go/v2 ``` -------------------------------- ### Install and Upgrade Convoy Helm Chart Source: https://www.getconvoy.io/docs/deployment/install-convoy/kubernetes These shell commands demonstrate how to install and upgrade the Convoy application using its Helm chart. A 'values.yaml' file is typically used to customize the installation. ```shell helm install --values values.yaml convoy convoy/convoy -n convoy helm upgrade --values values.yaml convoy convoy/convoy -n convoy ``` -------------------------------- ### Clone and Start Convoy with Docker Compose Source: https://www.getconvoy.io/docs/deployment/install-convoy This snippet demonstrates how to clone the Convoy repository from GitHub and start the local development services using Docker Compose. Ensure Docker and Docker Compose are installed and updated to the specified versions before running these commands. ```bash # Get the code $ git clone https://github.com/frain-dev/convoy.git # Go to the Convoy folder $ cd convoy # Start Services $ docker compose -f configs/local/docker-compose.yml up ``` -------------------------------- ### Golang: Install and Configure Convoy SDK Source: https://www.getconvoy.io/docs/sdk/sdk Shows how to install the convoy-go SDK and configure the client with API key or Basic Authentication credentials (username and password). ```golang import ( convoy "github.com/frain-dev/convoy-go/v2" ) c := convoy.New(convoy.Options{ APIKey: "your_api_key", }) cBasicAuth := convoy.New(convoy.Options{ APIUsername: "default", APIPassword: "default", }) ``` -------------------------------- ### Install Convoy Client (Javascript) Source: https://www.getconvoy.io/docs/guides/sending-webhook-example Installs the convoy.js library using npm. This is the first step to integrating Convoy into your Javascript application. ```bash npm install convoy.js ``` -------------------------------- ### Install Convoy Client (Ruby) Source: https://www.getconvoy.io/docs/guides/sending-webhook-example Installs the convoy.rb gem using the RubyGems package manager. This is the initial step for using Convoy within a Ruby application. ```bash gem install convoy.rb ``` -------------------------------- ### Javascript: Install and Configure Convoy SDK Source: https://www.getconvoy.io/docs/sdk/sdk Installs the convoy.js package and demonstrates configuration options including API key authentication, Basic Auth, and self-hosted instance URIs. Supports event and endpoint creation. ```javascript const { Convoy } = require("convoy.js"); const convoy = new Convoy({ api_key: "your_api_key" }); const convoyBasicAuth = new Convoy({ username: "default", password: "default" }); const convoySelfHosted = new Convoy({ api_key: "your_api_key", uri: "self-hosted-instance", }); ``` -------------------------------- ### Standard Circuit Breaker Configuration (JSON) Source: https://www.getconvoy.io/docs/product-manual/circuit-breaker An example of a standard JSON configuration for a circuit breaker. This setup balances responsiveness with stability, suitable for typical webhook endpoints. It defines polling frequency, failure and success thresholds, minimum request counts, observability window, error timeout, and consecutive failure limits. ```json { "sample_rate": 30, "failure_threshold": 70, "success_threshold": 10, "minimum_request_count": 10, "observability_window": 5, "error_timeout": 60, "consecutive_failure_threshold": 10 } ``` -------------------------------- ### POST /ui/auth/google/setup Source: https://www.getconvoy.io/docs/product-manual/google-sso Completes the first-time user setup process after successful Google OAuth authentication. New users are required to provide their business name. ```APIDOC ## POST /ui/auth/google/setup ### Description Completes the first-time user setup for new users after they have authenticated via Google OAuth. This endpoint allows the user to provide essential organization details. ### Method POST ### Endpoint /ui/auth/google/setup ### Parameters #### Request Body - **business_name** (string) - Required - The name of the user's organization. ### Request Example { "business_name": "My Awesome Company" } ### Response #### Success Response (200) - **message** (string) - A success message indicating that the setup is complete. - **dashboard_url** (string) - The URL to the user's Convoy dashboard. #### Response Example { "message": "Setup complete. Redirecting to dashboard.", "dashboard_url": "/dashboard" } ``` -------------------------------- ### Build Convoy CLI from Source Source: https://www.getconvoy.io/docs/cli-file/convoy Builds the Convoy CLI from its GitHub source code. Requires Go, NodeJS, and npm to be installed. After cloning the repository, the 'make build' command compiles the project. ```bash $ git clone https://github.com/frain-dev/convoy.git && cd convoy $ make build ``` -------------------------------- ### Verify Convoy CLI Installation Source: https://www.getconvoy.io/docs/cli-file/convoy Verifies that the Convoy CLI has been successfully installed or built by checking its version. This command should output the installed Convoy version. ```bash $ convoy -v Convoy version v0.6.0 ``` -------------------------------- ### ArgoCD Helm Hook Configuration for Migrations Source: https://www.getconvoy.io/docs/deployment/install-convoy/kubernetes This snippet defines Helm hooks for managing migrations during installation and upgrades. It specifies that hooks should run after installation and upgrade, and be deleted before a new hook is created. These are typically part of a Helm chart's template files. ```yaml 'helm.sh/hook': post-install,post-upgrade 'helm.sh/hook-delete-policy': before-hook-creation ``` -------------------------------- ### Start Smokescreen as a Forward Proxy (Bash) Source: https://www.getconvoy.io/docs/product-manual/forward-proxies/smokescreen This command starts the Smokescreen service, configuring it to listen on a specified port. It acts as the initial setup for using Smokescreen as a forward proxy. ```bash smokescreen --listen-port ``` -------------------------------- ### Install Convoy CLI on Ubuntu/Debian Source: https://www.getconvoy.io/docs/cli-file/convoy Installs the Convoy CLI on Ubuntu and Debian-based Linux distributions by adding the Convoy apt repository and then installing the package. Requires curl and sudo privileges. ```bash $ curl -1sLf 'https://dl.cloudsmith.io/public/convoy/convoy/setup.deb.sh' | sudo -E bash $ sudo apt install convoy ``` -------------------------------- ### API Versioning Guide Source: https://www.getconvoy.io/docs/api-reference/versioning This section details Convoy's approach to API versioning, focusing on maintaining backwards compatibility and managing breaking changes. ```APIDOC ## API Versioning Convoy's API is designed for backwards compatibility. New releases may not always include breaking API changes. ### Current Default Version The current default API version is `2024-01-01`. ### Specifying API Version You can lock your instance to a specific version or make per-request calls: 1. **Configuration File:** Specify `api_version` in your `convoy.json`. 2. **Request Header:** Use the `X-Convoy-Version` header in your requests. ### Backwards-Compatible Changes Convoy considers the following changes backwards-compatible: * Adding new API resources. * Adding new optional request parameters. * Adding new properties to existing responses. * Changing the order of properties in responses. * Changing the length or format of opaque strings (e.g., object IDs, error messages). * This includes adding or removing fixed prefixes (e.g., `en_`). * Ensure integrations can handle Convoy-generated object IDs up to 255 characters. * Adding new event types. * Webhook listeners should gracefully handle unfamiliar event types. ### Compatibility Matrix | Convoy Version | API Version | | -------------- | ------------ | | `v24.4.1` | `2024-04-01` | | `v24.1.1` | `2024-01-01` | ### Breaking Changes #### Version `2024-04-01` * `title` endpoint field renamed to `name`. * `target_url` endpoint field renamed to `url`. #### Version `2024-01-01` * `http_timeout` and `rate_limit_duration` changed from duration string to integer. * Default signature format changed from `simple` to `advanced`. * Unnecessary fields stripped from dynamic API endpoints. ``` -------------------------------- ### List Available Convoy CLI Commands Source: https://www.getconvoy.io/docs/cli-file/convoy Displays all available subcommands and global flags for the Convoy CLI. Running 'convoy' without any arguments shows this help information. ```text $ convoy High Performance Webhooks Gateway Usage: Convoy [command] Available Commands: bootstrap bootstrap creates a new user account completion generate the autocompletion script for the specified shell config config outputs your instances computed configuration help Help about any command ingest Ingest webhook events from Pub/Sub streams migrate Convoy migrations retry retry event deliveries with a particular status in a timeframe scheduler scheduler runs periodic tasks server Start the HTTP server stream Start a websocket server to pipe events to a convoy cli instance version Print the version worker Start worker instance Flags: --config string Configuration file for convoy (default "./convoy.json") --license-key string License key --db-database string Database Database --db-host string Database Host --db-options string Database Options --db-password string Database Password --db-port int Database Port --db-scheme string Database Scheme --db-type string Database provider --db-username string Database Username -h, --help help for Convoy --redis-database string Redis database --redis-host string Redis Host --redis-password string Redis Password --redis-port int Redis Port --redis-scheme string Redis Scheme --redis-type string Redis provider --redis-username string Redis Username -v, --version version for Convoy ``` -------------------------------- ### Custom Headers Example for Event Ingestion Source: https://www.getconvoy.io/docs/product-manual/events-and-event-deliveries This example demonstrates how to include custom HTTP headers when ingesting an event. Any key-value pairs provided in the `custom_headers` object will be appended to the outgoing webhook request. This can be used for passing metadata or authentication tokens. The example shows a `sample-header` with a `sample-value`. ```json { "event_type": "log.sampled", "data": { "foo": "bar" }, "custom_headers": { "sample-header": "sample-value" } } ``` -------------------------------- ### Convoy Agent Command Help Source: https://www.getconvoy.io/docs/cli-file/convoy Displays the help information for the 'convoy agent' command, outlining its usage and available flags. This includes flags for agent-specific settings like ports and consumer pool size, as well as SMTP configuration details. ```txt $ convoy agent -h Start agent instance Usage: Convoy agent [flags] Flags: --agent-port uint32 Agent port --consumers int Size of the consumers pool. (default -1) -h, --help help for agent --ingest-port uint32 Ingest port --interval int the time interval, measured in seconds to update the in-memory store from the database (default 10) --log-level string scheduler log level --mode string Execution Mode (one of events, retry and default) --smtp-from string Sender email address --smtp-password string SMTP authentication password --smtp-port uint32 SMTP Port --smtp-provider string SMTP provider --smtp-reply-to string Email address to reply to --smtp-ssl Enable SMTP SSL --smtp-url string SMTP provider URL --smtp-username string SMTP authentication username --worker-port uint32 Worker port Global Flags: --config string Configuration file for convoy (default "./convoy.json") --db-database string Database Database --db-host string Database Host --db-options string Database Options --db-password string Database Password --db-port int Database Port --db-scheme string Database Scheme --db-type string Database provider --db-username string Database Username --enable-feature-flag strings List of feature flags to enable e.g. "full-text-search,prometheus" --enable-profiling Enable profiling and exporting profile data to pyroscope --max-retry-seconds uint Max retry seconds exponential backoff (default 7200) --metrics-backend string Metrics backend e.g. prometheus. ('prometheus' feature flag required (default "prometheus") --metrics-prometheus-sample-time uint Prometheus metrics sample time (default 5) --otel-auth-header-name string OTel backend auth header name --otel-auth-header-value string OTel backend auth header value --otel-collector-url string OTel collector URL --otel-sample-rate float OTel tracing sample rate (default 1) --redis-database string Redis database --redis-host string Redis Host --redis-password string Redis Password --redis-port int Redis Port --redis-scheme string Redis Scheme --redis-type string Redis provider --redis-username string Redis Username --retention-policy string SMTP Port --retention-policy-enabled SMTP Port --sentry-dsn string Sentry backend dsn --tracer-type string Tracer backend, e.g. sentry, datadog or otel ``` -------------------------------- ### Meta Event Signature Verification (Conceptual) Source: https://www.getconvoy.io/docs/product-manual/meta-events This conceptual example demonstrates how to verify the signature of an incoming meta event payload using a shared secret. It involves hashing the raw payload with SHA256 and comparing it against the `X-Convoy-Signature` header. This ensures the event originated from Convoy and was not tampered with. ```pseudocode function verify_signature(secret, payload, signature_header) { // Calculate the expected signature expected_signature = hmac_sha256(secret, payload, 'hex'); // Compare with the provided signature if (expected_signature == signature_header) { return true; // Signature is valid } else { return false; // Signature is invalid } } ``` -------------------------------- ### Webhook Payload Structure Example (JSON) Source: https://www.getconvoy.io/docs/guides/best-practices-for-generating-webhook-events Demonstrates a recommended JSON structure for webhook payloads, emphasizing nested resources and including all data within a single object. This structure aims for clarity and ease of parsing by consumers. ```json { "event_type": "order.created", "data": {} } ``` -------------------------------- ### Example Meta Event Payload Structure Source: https://www.getconvoy.io/docs/product-manual/meta-events This snippet shows the structure of a meta event payload as received by a webhook. It includes details about the request, response, status, and metadata related to the event, such as retry information. ```json { "event_id": "some-event-id", "status": "Failure", "metadata": { "data": { "data": "test event from Convoy", "amount": 1000, "convoy": "https://getconvoy.io" }, "raw": "{\"data\":\"test event from Convoy\",\"convoy\":\"https://getconvoy.io\",\"amount\":1000}", "strategy": "linear", "next_send_time": "2023-06-29T15:05:06.123529+01:00", "num_trials": 3, "interval_seconds": 2, "retry_limit": 3 }, "description": "Retry limit exceeded", "created_at": "2023-06-29T15:04:51.858865+01:00", "updated_at": "2023-06-29T15:04:59.138633+01:00" } ``` -------------------------------- ### JSON Regex Filter Example Source: https://www.getconvoy.io/docs/product-manual/filters This example demonstrates how to define a JSON regex filter in Convoy. It specifies that the 'event_type' field must match a regular expression starting with 'es_' followed by one or more alphabetic characters. This is useful for filtering events based on specific naming conventions. ```json { "event_type": { "$regex": "^es_[a-zA-Z]+$" } } ``` -------------------------------- ### Initialize Convoy SDK (Go) Source: https://www.getconvoy.io/docs/guides/sending-webhook-example Initializes the Convoy client with API key and endpoint. Requires API key and self-hosted instance URL for proper configuration. ```go c := convoy.New(convoy.Options{ APIKey: "your_api_key", APIEndpoint: "self-hosted-instance", }) ``` -------------------------------- ### Get Help for a Specific Convoy CLI Command Source: https://www.getconvoy.io/docs/cli-file/convoy Retrieves detailed help information for a specific Convoy CLI subcommand, such as 'worker'. This is done by appending the '-h' flag to the subcommand. ```bash convoy worker -h ``` -------------------------------- ### Enable Circuit Breaker via CLI Flag Source: https://www.getconvoy.io/docs/product-manual/circuit-breaker Enables the circuit breaker feature using the --enable-feature-flag command-line interface flag when starting the Convoy server. This provides an alternative to environment variables for self-hosted setups. ```shell convoy server --config convoy.json --enable-feature-flag=circuit-breaker ``` -------------------------------- ### Configure SMTP Email Backend Source: https://www.getconvoy.io/docs/deployment/configuration Sets up the SMTP configuration for sending emails, such as notification emails. Includes provider, URL, port, username, password, and sender email address. Environment variable equivalents are provided. The provider is a string, while URL, username, password, and sender are strings. Port is an integer. ```json { "smtp": { "provider": "sendgrid", "url": "smtp.sendgrid.net", "port": 2525, "username": "apikey", "password": "api-key-from-sendgrid", "from": "[email protected]" } } ``` -------------------------------- ### Add and Update Helm Chart Repository Source: https://www.getconvoy.io/docs/deployment/install-convoy/kubernetes These shell commands add the Convoy Helm chart repository and then update the local Helm chart repository cache. Ensure Helm 3 or above is installed. ```shell helm repo add convoy https://frain-dev.github.io/helm-charts helm repo update ``` -------------------------------- ### Initialize Convoy SDK with API Key Source: https://www.getconvoy.io/docs/sdk/sdk Initializes the Convoy SDK using an API key. This is the standard way to connect to the Convoy API. Ensure you replace 'your_api_key' with your actual API key. ```golang c := convoy.New( convoy.APIKey("your_api_key"), ) ``` -------------------------------- ### Lenient Circuit Breaker Configuration (JSON) Source: https://www.getconvoy.io/docs/product-manual/circuit-breaker An example of a lenient JSON configuration for a circuit breaker, suitable for endpoints that can tolerate occasional failures. This setup involves less frequent checks, higher failure tolerance, easier recovery criteria, and a higher threshold for consecutive failures, reducing sensitivity to transient problems. ```json { "sample_rate": 60, "failure_threshold": 85, "success_threshold": 5, "minimum_request_count": 20, "observability_window": 10, "error_timeout": 120, "consecutive_failure_threshold": 15 } ``` -------------------------------- ### Install Convoy CLI on macOS with Homebrew Source: https://www.getconvoy.io/docs/cli-file/convoy Installs the Convoy CLI on macOS using the Homebrew package manager. This is a straightforward installation method for macOS users. ```bash brew tap frain-dev/tools brew install convoy ``` -------------------------------- ### Ruby: Create Convoy Endpoint and Subscription Source: https://www.getconvoy.io/docs/sdk/sdk Demonstrates creating a new endpoint with URL and description, and then creating a subscription for that endpoint using the Convoy Ruby SDK. Includes saving the created resources. ```ruby endpoint = Convoy::Endpoint.new( data: { "description": "Endpoint One", "http_timeout": "1m", "url": "https://webhook.site/73932854-a20e-4d04-a151-d5952e873abd" } ) endpoint_response = endpoint.save subscription = Convoy::Subscription.new( data: { endpoint_id: endpoint_id, name: 'ruby subscription' } ) subscription_response = subscription.save ``` -------------------------------- ### Convoy CLI listen Command Help Source: https://www.getconvoy.io/docs/cli-file/convoy-cli Displays help information for the 'convoy listen' command. This command starts a websocket client to listen to events streamed by the server and forward them to a specified web server. It supports flags for forwarding destination, timestamp filtering, and source naming. ```bash $ convoy listen --help Starts a websocket client that listens to events streamed by the server Usage: convoy-cli listen [flags] Flags: --forward-to string The host/web server you want to forward events to -h, --help help for listen --since string Send discarded events since a timestamp (e.g. 2013-01-02T13:23:37Z) or relative time (e.g. 42m for 42 minutes) --source-name string The name of the source you want to receive events from (only applies to incoming projects) ``` -------------------------------- ### Install Convoy CLI on CentOS/RHEL Source: https://www.getconvoy.io/docs/cli-file/convoy Installs the Convoy CLI on CentOS and RHEL-based Linux distributions using yum after setting up the Convoy rpm repository. Requires curl and sudo privileges. ```bash $ curl -1sLf 'https://dl.cloudsmith.io/public/convoy/convoy/setup.rpm.sh' | sudo -E bash $ sudo yum install convoy ``` -------------------------------- ### Configure Convoy Client (Golang) Source: https://www.getconvoy.io/docs/guides/sending-webhook-example Initializes the Convoy client in Golang using an API key. Alternatively, authentication can be performed using Basic Auth by providing a username and password. The URL for self-hosted instances can also be specified. ```go import ( convoy "github.com/frain-dev/convoy-go/v2" ) c := convoy.New(convoy.Options{ APIKey: "your_api_key", }) c := convoy.New(convoy.Options{ APIUsername: "default", APIPassword: "default", }) ``` -------------------------------- ### Initialize Convoy SDK for Self-Hosted Instance Source: https://www.getconvoy.io/docs/sdk/sdk Initializes the Convoy SDK for a self-hosted Convoy instance. This requires specifying the API endpoint URL along with the API key. Replace 'self-hosted-instance' with the actual URL of your self-hosted Convoy deployment. ```golang c := convoy.New(convoy.Options{ APIKey: "your_api_key", APIEndpoint: "self-hosted-instance", }) ``` -------------------------------- ### Idempotency Key Example for Deduplication Source: https://www.getconvoy.io/docs/product-manual/events-and-event-deliveries This example illustrates the use of an `idempotency_key` to prevent duplicate event processing. By providing a unique key for each event, Convoy can identify and ignore subsequent attempts to send the same event. This ensures that actions are performed only once, even if multiple requests are made. The example includes `event_type`, `data`, `custom_headers`, and a unique `idempotency_key`. ```json { "event_type": "log.sampled", "data": { "foo": "bar" }, "custom_headers": { "sample-header": "sample-value" }, "idempotency_key": "my-unique-key" } ``` -------------------------------- ### Example Advanced Signature Request Header Source: https://www.getconvoy.io/docs/product-manual/signatures Presents an example of an HTTP request header containing an advanced webhook signature. The signature is composed of a timestamp and multiple signature versions. ```json { Content-Type: "application/json", X-Convoy-Signature: "t=1492774577,v1=ansdoj213e98jqd928u3eudh239eu2j9d2jd8ejd238eu23ei2d9j23e8u23eue3v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd,v0=6ffbb59b2300aae63f272406069a9788598b792a944a07aba816edb039989a39" } ``` -------------------------------- ### Create an Endpoint with Convoy SDK (Go) Source: https://www.getconvoy.io/docs/guides/sending-webhook-example Creates a new webhook endpoint using the Convoy Go SDK. Requires an application UID and endpoint details (URL, Description). Returns the created endpoint object or an error. ```go endpoint, err := c.Endpoints.Create(app.UID, &Convoy.CreateEndpointRequest{ URL: "", Description: "", }, nil) if err != nil { log.Fatal("failed to create app endpoint \n", err) } ``` -------------------------------- ### Convoy Configuration Reference (JSON) Source: https://www.getconvoy.io/docs/deployment/configuration This JSON object defines the configuration parameters for a Convoy instance. It includes settings for API version, host, database connection details (PostgreSQL specific), connection pooling, read replicas, and server HTTP/SSL ports. Environment variables are provided as equivalents for most settings. ```json { "api_version": "2024-01-01", "host": "hooks.domain.com", "database": { "host": "localhost", "scheme": "postgres", "username": "postgres", "password": "postgres", "database": "convoy", "options": "sslmode=disable&connect_timeout=30", "port": 5432, "max_open_conn": 10, "max_idle_conn": 10, "conn_max_lifetime": 10, "read_replicas": [ { "dsn": "postgres://convoy:convoy@localhost:5436/convoy", "host": "localhost", "username": "convoy", "password": "convoy", "database": "convoy", "port": 5436 }, { "host": "localhost", "username": "convoy", "password": "convoy", "database": "convoy", "port": 5437 } ] }, "server": { "http": { "ssl": false, "ssl_cert_file": "", "ssl_key_file": "", "port": 5005, "worker_port": 5006 } } } ``` -------------------------------- ### Invoice Created Event Payload Example (JSON) Source: https://www.getconvoy.io/docs/product-manual/webhooks-documentation An example JSON payload for an 'invoice.created' webhook event. This structure includes the event type and the data associated with the invoice, such as its ID and status. This is useful for understanding the data structure your application will receive. ```json { "event_type": "invoice.created", "data": { "id": "inv_3234aei32489aie2o3245", "status": "created" } } ``` -------------------------------- ### Configure Convoy Client (Javascript) Source: https://www.getconvoy.io/docs/guides/sending-webhook-example Initializes the Convoy client in Javascript with your API key and URI. For self-hosted instances, specify your convoy instance URI; otherwise, use the appropriate cloud-based service URI based on your region. ```javascript const { Convoy } = require('convoy.js'); const convoy = new Convoy({ api_key: 'your_api_key', uri: 'your_uri' }); ``` -------------------------------- ### Retry Stuck Events in Convoy (Bash) Source: https://www.getconvoy.io/docs/deployment/install-convoy/troubleshooting Resolves issues where Convoy events remain in 'Scheduled' or 'Processing' states due to a bug in older versions. Users should update Convoy and use the provided commands to retry events. This requires either the Convoy binary or Docker to be installed. ```bash # if you are using the binary convoy retry --status="Scheduled" --time="1h" # if you are using docker docker run -d -p 5009:5009 --name retry -v `pwd`/convoy.json:/convoy.json your-convoy-image:tag retry --status="Processing" --time="1h" ``` -------------------------------- ### Invoice Paid Event Payload Example (JSON) Source: https://www.getconvoy.io/docs/product-manual/webhooks-documentation An example JSON payload for an 'invoice.paid' webhook event. Similar to the 'invoice.created' event, this shows the structure including event type and invoice data, specifically indicating a 'paid' status. This helps in differentiating between various invoice states received via webhooks. ```json { "event_type": "invoice.created", "data": { "id": "inv_3234aei32489aie2o3245", "status": "paid" } } ``` -------------------------------- ### Example Simple Signature Source: https://www.getconvoy.io/docs/product-manual/signatures Demonstrates the format of a simple webhook signature used by Convoy. This signature is a plain hash string. ```json X-Convoy-Signature: 6ffbb59b2300aae63f272406069a9788598b792a944a07aba816edb039989a39 ``` -------------------------------- ### Configure Read Replicas using CLI Source: https://www.getconvoy.io/docs/product-manual/read-replicas This command demonstrates how to configure read replicas using the `read-replicas-dsn` option in the Convoy CLI. It requires a comma-separated list of database connection strings, each specifying the DBMS, username, password, host, port, and database name. The `--enable-feature-flag` is also included to activate the read replica feature. ```shell convoy server --enable-feature-flag=read-replicas --read-replicas-dsn="postgres://convoy:convoy@localhost:5436/convoy,postgres://convoy:convoy@localhost:5437/convoy" ``` -------------------------------- ### Configure Convoy Client (Ruby) Source: https://www.getconvoy.io/docs/guides/sending-webhook-example Configures the Convoy client in Ruby by setting the API key and project ID globally. Ensure SSL is enabled if required by your Convoy instance. ```ruby require 'convoy' Convoy.ssl = true Convoy.api_key = "CO.M0aBe..." Convoy.project_id = "23b1..." ```