New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cubetiq/hookme-sdk

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubetiq/hookme-sdk

A simple way to send webhook request to the server

  • 0.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
Maintainers
0
Weekly downloads
 
Created
Source

Hookme SDK for Node

A simple way to send webhook request to the server.

  • Send webhook request with payload.
  • Cache the request if the server is not available and send it later.
  • Support retry mechanism. (Support interval retry mechanism)
  • Check the duplicate request before sending (If the request is sending, drop the request).
  • Support enqueue the request to the queue.
  • Enhance the enqueue to the queue with storage (Add the storage to store the request for later sending).
  • Support batch request sending for enqueue.
  • Support scheduler and allow to schedule the job for do webhook callback.
  • Add support Telegram send with photo and file url.

Usages

// Import the HookmeClient SDK
import HookmeClient from '@cubetiq/hookme-sdk';

// Create the HookmeClient instance
const sdk = HookmeClient.create({
    url: 'hookme_url',
    tenantId: 'default',
    apiKey: 'api_key',
});

// Send the webhook request
const request = WebhookRequest.builder()
    .provider('telegram')
    .data({
        telegram: {
            chat_id: 123, // please replace with your chat_id (must a correct chat_id)
            bot_token: '123', // please replace with your bot_token (must a correct bot_token)
        },
        message: 'Hello, world!',
        photo: 'https://example.com/photo.jpg', // please replace with your photo url, if you want to send photo
        file: 'https://example.com/file.pdf', // please replace with your file url, if you want to send file
    })
    .build();

const response = await sdk.post(request);
console.log('Request: ', request);
// Output: {"provider":"telegram","data":{"telegram":{"chat_id":123,"bot_token":"123"},"message":"Hello, world!"}}
console.log('Response: ', response);
// Output: {id: "gKw9yH0vq7YGm-yqeiNMlg=="",status: "pending",created_at: "2024-05-29T11:17:45.295Z"}

Issues

  • When send error with using file store, the interval will auto send the request again and again (this should be change and should delay the with exponential backoff).

Contributors

  • Sambo Chea sombochea@cubetiqs.com

Keywords

FAQs

Package last updated on 05 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc