Skip to content

Latest commit

 

History

History
94 lines (66 loc) · 2.14 KB

File metadata and controls

94 lines (66 loc) · 2.14 KB

ThreadSync Ruby SDK

Gem Version License Ruby

Official Ruby SDK for the ThreadSync API — enterprise data integration platform.

Installation

Preview: SDKs are in preview and installed from GitHub. RubyGems packages will be available at GA.

Add to your Gemfile:

gem 'threadsync', git: 'https://github.com/threadsync-infrastructure/threadsync-ruby.git'

Then run:

bundle install

Quick Start

require 'threadsync'

client = ThreadSync::Client.new(bearer_token: 'your-bearer-token')

# Create a connection
connection = client.connections.create(provider: 'salesforce')
puts "Connection ID: #{connection.id}, Status: #{connection.status}"

# Retrieve a connection
fetched = client.connections.get(connection.id)

# Create a sync
sync = client.sync.create(
  source: {
    connection: 'conn_salesforce_123',
    object: 'Contact',
    table: 'contacts'
  },
  destination: {
    connection: 'conn_postgres_456',
    object: 'record',
    table: 'salesforce_contacts'
  },
  schedule: '0 * * * *'
)
puts "Sync ID: #{sync.id}, Status: #{sync.status}"

# Check sync status
result = client.sync.get(sync.id)
puts "Records synced: #{result.records_synced}"

API Reference

ThreadSync::Client

Parameter Type Description
bearer_token: String Your ThreadSync API key
base_url: String Override the API base URL (optional)

client.connections

Method Description
create(provider:) Create a new connection
get(id) Retrieve a connection by ID

client.sync

Method Description
create(source:, destination:, schedule:) Create a new sync job
get(id) Retrieve a sync job by ID

Models

  • Connectionid, provider, name, status
  • SyncResultid, status, records_synced

Requirements

  • Ruby 3.0 or later

License

MIT — see LICENSE for details.