0.6.0 • Published 5 months ago

@hoshinorei/bark-sdk v0.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Typescript Bark SDK

Introduction

An SDK for Bark written in TypeScript.

Features

  • Using Bark V2 API
  • Encrypted push
  • Working in the browser and Node.js
  • Check if the Bark server is healthy
  • Check if the Bark server is running
  • Get Bark server information

Getting started

Install

pnpm
pnpm add @hoshinorei/bark-sdk
Yarn
yarn add @hoshinorei/bark-sdk
npm
npm i @hoshinorei/bark-sdk

Push a simple message

import { BarkClient, BarkMessageBuilder } from "@hoshinorei/bark-sdk"

const barkClient = new BarkClient("<your_bark_server_url>")

barkClient.push(
  new BarkMessageBuilder()
    .body("<your_body>")
    .deviceKey("<your_device_key>")
    .title("<your_title>")
    .build(),
)

Push an encrypted message

import {
  BarkClient,
  BarkEncryptedPushAlgorithm,
  BarkMessageBuilder,
} from "@hoshinorei/bark-sdk"

const barkClient = new BarkClient("<your_bark_server_url>")

barkClient.pushEncrypted(
  "<your_device_key>",
  new BarkMessageBuilder().body("<your_body>").title("<your_title>").build(),
  BarkEncryptedPushAlgorithm.AES_128_CBC, // You can view the supported algorithms via the link below
  "<your_key>",
  "<your_iv>",
)

Supported algorithm

For More usage, please read wiki.

License

MIT

0.6.0

5 months ago

0.5.1

6 months ago

0.5.0

6 months ago

0.4.0

6 months ago

0.3.0

7 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.1

9 months ago

0.1.0

9 months ago