SDKs & Libraries

Official and community SDKs to integrate Sales Webhooks into your application faster.

Official SDKs

These SDKs are maintained by the Sales Webhooks team and kept up-to-date with the latest API features.

Node.js / TypeScript

Official

Full-featured SDK with TypeScript support, async/await, and automatic retries.

Installation

npm install @saleswebhooks/node
# or
yarn add @saleswebhooks/node

Quick Example

import { SalesWebhooks } from '@saleswebhooks/node';

const client = new SalesWebhooks({
  apiKey: process.env.SALESWEBHOOKS_API_KEY
});

// Create a subscription
const subscription = await client.subscriptions.create({
  entityType: 'contact',
  linkedinUrl: 'https://linkedin.com/in/jane-smith'
});

// Configure webhook
const webhook = await client.webhooks.configure({
  endpointUrl: 'https://your-app.com/webhook',
  events: ['contact.position_changed']
});

Python

Official

Pythonic SDK with type hints, async support, and webhook signature verification.

Installation

pip install saleswebhooks

Quick Example

from saleswebhooks import SalesWebhooks

client = SalesWebhooks(api_key="lwa.sk_live_...")

# Create a subscription
subscription = client.subscriptions.create(
    entity_type="contact",
    linkedin_url="https://linkedin.com/in/jane-smith"
)

# Configure webhook
webhook = client.webhooks.configure(
    endpoint_url="https://your-app.com/webhook",
    events=["contact.position_changed"]
)

# Verify webhook signature
is_valid = client.webhooks.verify_signature(
    payload=request.body,
    signature=request.headers["X-Webhook-Signature"],
    secret=webhook.secret
)

Community SDKs

These SDKs are created and maintained by the community. We're grateful for their contributions!

Ruby

Community

Ruby gem with Rails integration and ActiveJob support.

Installation

gem install sales_webhooks
# or add to Gemfile
gem 'sales_webhooks'

Quick Example

require 'sales_webhooks'

client = SalesWebhooks::Client.new(api_key: ENV['SALESWEBHOOKS_API_KEY'])

# Create subscription
subscription = client.subscriptions.create(
  entity_type: 'contact',
  linkedin_url: 'https://linkedin.com/in/jane-smith'
)

# Rails webhook controller
class WebhooksController < ApplicationController
  def saleswebhooks
    signature = request.headers['X-Webhook-Signature']
    
    if SalesWebhooks.verify_signature(request.raw_post, signature)
      ProcessWebhookJob.perform_later(params)
      head :ok
    else
      head :unauthorized
    end
  end
end

PHP

Community

PHP SDK with PSR compliance and Laravel integration.

Installation

composer require saleswebhooks/php-sdk

Quick Example

<?php
use SalesWebhooks\Client;

$client = new Client($_ENV['SALESWEBHOOKS_API_KEY']);

// Create subscription
$subscription = $client->subscriptions->create([
    'entity_type' => 'contact',
    'linkedin_url' => 'https://linkedin.com/in/jane-smith'
]);

// Laravel webhook route
Route::post('/webhook', function (Request $request) use ($client) {
    $signature = $request->header('X-Webhook-Signature');
    
    if ($client->webhooks->verifySignature($request->getContent(), $signature)) {
        ProcessWebhook::dispatch($request->all());
        return response('OK', 200);
    }
    
    return response('Unauthorized', 401);
});

Go

Community

Idiomatic Go client with context support and zero dependencies.

Installation

go get github.com/saleswebhooks/go-sdk

Quick Example

package main

import (
    "context"
    "github.com/saleswebhooks/go-sdk"
)

func main() {
    client := saleswebhooks.NewClient("lwa.sk_live_...")
    
    // Create subscription
    subscription, err := client.Subscriptions.Create(context.Background(), &saleswebhooks.CreateSubscriptionParams{
        EntityType:  "contact",
        LinkedInURL: "https://linkedin.com/in/jane-smith",
    })
    
    // Webhook handler
    http.HandleFunc("/webhook", func(w http.ResponseWriter, r *http.Request) {
        signature := r.Header.Get("X-Webhook-Signature")
        body, _ := ioutil.ReadAll(r.Body)
        
        if client.Webhooks.VerifySignature(body, signature) {
            // Process webhook
            go processWebhook(body)
            w.WriteHeader(http.StatusOK)
        } else {
            w.WriteHeader(http.StatusUnauthorized)
        }
    })
}

Direct HTTP Client Examples

If there's no SDK for your language, you can use any HTTP client. Here are examples for common scenarios:

cURL

# Create subscription
curl -X POST https://api.saleswebhooks.com/v1/subscriptions \
  -H "X-API-Key: lwa.sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "entity_type": "contact",
    "linkedin_url": "https://linkedin.com/in/jane-smith"
  }'

# List subscriptions
curl https://api.saleswebhooks.com/v1/subscriptions \
  -H "X-API-Key: lwa.sk_live_YOUR_API_KEY"

JavaScript (Fetch API)

class SalesWebhooksClient {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.baseUrl = 'https://api.saleswebhooks.com/v1';
  }

  async request(path, options = {}) {
    const response = await fetch(`${this.baseUrl}${path}`, {
      ...options,
      headers: {
        'X-API-Key': this.apiKey,
        'Content-Type': 'application/json',
        ...options.headers
      }
    });

    if (!response.ok) {
      throw new Error(`API Error: ${response.status}`);
    }

    return response.json();
  }

  async createSubscription(data) {
    return this.request('/subscriptions', {
      method: 'POST',
      body: JSON.stringify(data)
    });
  }

  async listSubscriptions(params = {}) {
    const query = new URLSearchParams(params);
    return this.request(`/subscriptions?${query}`);
  }
}

// Usage
const client = new SalesWebhooksClient('lwa.sk_live_...');
const subscription = await client.createSubscription({
  entity_type: 'contact',
  linkedin_url: 'https://linkedin.com/in/jane-smith'
});

Postman Collection

Import our Postman collection to explore the API interactively:

Sales Webhooks API Collection

Complete API collection with examples for all endpoints

View in Postman

Creating Your Own SDK

Building an SDK for Sales Webhooks? Here are the key features to implement:

Essential Features

  • Authentication: API key header management
  • Error handling: Parse error responses and throw appropriate exceptions
  • Rate limiting: Respect rate limit headers and implement backoff
  • Webhook verification: HMAC-SHA256 signature verification
  • Pagination: Handle paginated responses automatically
  • Retries: Implement exponential backoff for failed requests

SDK Guidelines

// 1. Use consistent naming
client.subscriptions.create()  // Good
client.createSubscription()    // Also good
client.sub_create()           // Avoid

// 2. Return promises/futures for async operations
const subscription = await client.subscriptions.create(...);

// 3. Provide typed responses (TypeScript/Flow)
interface Subscription {
  id: string;
  entity_type: 'contact' | 'company';
  linkedin_id: string;
  // ...
}

// 4. Include webhook helpers
client.webhooks.verifySignature(payload, signature, secret);

// 5. Handle pagination transparently
for await (const subscription of client.subscriptions.list()) {
  // Automatically fetches all pages
}

// 6. Provide debug/logging options
const client = new SalesWebhooks({
  apiKey: '...',
  debug: true,
  logger: customLogger
});

Contributing an SDK

Created an SDK for Sales Webhooks? We'd love to feature it!

  1. Ensure your SDK follows our guidelines
  2. Include comprehensive documentation
  3. Add tests with >80% coverage
  4. Publish to your language's package manager
  5. Submit a PR to our awesome-saleswebhooks repo

🎁 SDK Contributors

We offer free Sales Webhooks subscriptions to active SDK maintainers. Contact us at sdk@saleswebhooks.com to learn more.

Next Steps