An open API service indexing awesome lists of open source software.

https://github.com/hoshinorei/typescript-bark-sdk

An SDK for Bark written in TypeScript
https://github.com/hoshinorei/typescript-bark-sdk

bark typescript

Last synced: 2 months ago
JSON representation

An SDK for Bark written in TypeScript

Awesome Lists containing this project

README

          

# Typescript Bark SDK

## Introduction

An SDK for [Bark](https://github.com/Finb/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

```shell
pnpm add @hoshinorei/bark-sdk
```

##### Yarn

```shell
yarn add @hoshinorei/bark-sdk
```

##### npm

```shell
npm i @hoshinorei/bark-sdk
```

#### Push a simple message

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

const barkClient = new BarkClient("")

barkClient.push(
new BarkMessageBuilder()
.body("")
.deviceKey("")
.title("")
.build(),
)
```

#### Push an encrypted message

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

const barkClient = new BarkClient("")

barkClient.pushEncrypted(
"",
new BarkMessageBuilder().body("").title("").build(),
BarkEncryptedPushAlgorithm.AES_128_CBC, // You can view the supported algorithms via the link below
"",
"",
)
```

[Supported algorithm](https://github.com/HoshinoRei/typescript-bark-sdk/wiki/BarkEncryptedPushAlgorithm#enumeration-members)

For More usage, please read [wiki](https://github.com/HoshinoRei/typescript-bark-sdk/wiki/Exports).

## License

[MIT](LICENSE)