@riffyh/adapter-niyaniya 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +47 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Riffy H niyaniya Adapter
2
+
3
+ An adapter allowing access to the niyaniya.moe data source.
4
+
5
+ ## Installation
6
+
7
+ 1. Install the `@riffyh/adapter-niyaniya` package.
8
+
9
+ ```bash
10
+ bun add @riffyh/adapter-niyaniya
11
+ ```
12
+
13
+ 2. Add the adapter to your server configuration.
14
+
15
+ ```ts
16
+ import { niyaniya } from "@riffyh/adapter-niyaniya";
17
+ import type { Config } from "@riffyh/commons";
18
+
19
+ const config: Config = {
20
+ dataSources: [
21
+ niyaniya({
22
+ crt: "<crt key>",
23
+ userAgent: "<browser user agent>",
24
+ }),
25
+ ],
26
+ };
27
+
28
+ export default config;
29
+ ```
30
+
31
+ ## Configuration
32
+
33
+ ### `crt`
34
+
35
+ - **Type:** `string`
36
+ - **Required:** Yes
37
+
38
+ Specifies the `crt` key for niyaniya.moe. You can obtain this key by monitoring network traffic in your browser's DevTools. The `crt` token should appear in the query parameters of certain requests (try navigating through a couple of galleries to find it).
39
+
40
+ _Note: This key may need to be rotated periodically._
41
+
42
+ ### `userAgent`
43
+
44
+ - **Type:** `string`
45
+ - **Required:** Yes
46
+
47
+ The browser user agent used when obtaining the `crt` token. You can sniff this from the fetch request headers or by running `navigator.userAgent` in your browser's DevTools console.
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@riffyh/adapter-niyaniya",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/rayriffy/rayriffy-h.git"
7
7
  },
8
8
  "files": [
9
- "dist/"
9
+ "dist/",
10
+ "README.md"
10
11
  ],
11
12
  "type": "module",
12
13
  "main": "dist/index.mjs",