bangkeut-technology/supportdock-sdk

SupportDock PHP SDK — submit feedback and manage FAQs from your PHP application

Maintainers

Package info

github.com/bangkeut-technology/supportdock-sdk

pkg:composer/bangkeut-technology/supportdock-sdk

Statistics

Installs: 18

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-04-03 04:00 UTC

This package is auto-updated.

Last update: 2026-04-03 04:10:29 UTC


README

Submit feedback and manage FAQs from your PHP application.

Requirements

  • PHP 8.1+
  • cURL extension

Installation

composer require bangkeut-technology/supportdock-sdk

Usage

Initialize the client

use SupportDock\SupportDockClient;

$client = new SupportDockClient([
    'apiKey' => 'sdk_your_api_key',
    // 'baseUrl' => 'https://supportdock.io',  // optional
    // 'timeout' => 10,                         // seconds, optional
    // 'defaultMetadata' => ['appVersion' => '1.0.0'],  // optional
]);

Send feedback

$result = $client->sendFeedback([
    'type' => 'bug',           // 'bug' | 'feature' | 'question' | 'general'
    'message' => 'App crashes on login page',
    'email' => 'user@example.com',  // optional
    'name' => 'Jane Doe',           // optional
    'subject' => 'Login crash',     // optional, auto-generated if omitted
    'metadata' => [                 // optional
        'appVersion' => '2.0.0',
        'platform' => 'web',
    ],
]);
// $result = ['success' => true]

List FAQs

$faqs = $client->listFAQs();
// Returns array of FAQ objects

Create a FAQ

$faq = $client->createFAQ([
    'question' => 'How do I reset my password?',
    'answer' => 'Go to Settings > Account > Reset Password.',
    'sortOrder' => 1,  // optional
]);

Update a FAQ

$faq = $client->updateFAQ('faq-id-here', [
    'answer' => 'Updated answer text.',
]);

Delete a FAQ

$result = $client->deleteFAQ('faq-id-here');
// $result = ['success' => true]

Error handling

use SupportDock\Exception\SupportDockException;
use SupportDock\Exception\ValidationException;
use SupportDock\Exception\RateLimitException;

try {
    $client->sendFeedback(['message' => 'Bug report']);
} catch (RateLimitException $e) {
    // 429 — too many requests (5 per 15-minute window)
    echo "Rate limited: " . $e->getMessage();
} catch (ValidationException $e) {
    // Client-side validation failed
    echo "Invalid input: " . $e->getMessage();
} catch (SupportDockException $e) {
    // API error (401, 403, 404, etc.)
    echo "Error ({$e->getStatusCode()}): " . $e->getMessage();
}

API reference

Method Description
sendFeedback(array $options) Submit feedback (bug, feature, question, general)
listFAQs() List all FAQs for the app
createFAQ(array $options) Create a new FAQ entry
updateFAQ(string $faqId, array $options) Update an existing FAQ
deleteFAQ(string $faqId) Delete a FAQ entry

License

MIT