generated from HoshinoRei/typescript-npm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
github-actions[bot] edited this page Dec 5, 2023
·
13 revisions
An SDK for Bark written in TypeScript.
- 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
pnpm add @hoshinorei/bark-sdk
yarn add @hoshinorei/bark-sdk
npm i @hoshinorei/bark-sdk
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(),
)
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>",
)
For More usage, please read wiki.