offrouter-openrouter 0.34.0 → 0.35.0

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 +38 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # offrouter-openrouter
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/offrouter-openrouter)](https://www.npmjs.com/package/offrouter-openrouter)
4
+ [![npm downloads](https://img.shields.io/npm/dm/offrouter-openrouter)](https://www.npmjs.com/package/offrouter-openrouter)
5
+ [![MIT license](https://img.shields.io/badge/license-MIT-blue)](https://opensource.org/license/mit)
6
+
3
7
  OpenRouter provider package for OffRouter.
4
8
 
5
9
  ## Install
@@ -10,14 +14,47 @@ npm install offrouter-openrouter
10
14
 
11
15
  ## Usage
12
16
 
17
+ Use Node.js 22 or later. Export the activation variables before running this example.
18
+ The package does not load `.env` files.
19
+
13
20
  ```ts
14
21
  import { createOpenRouterAdapter } from "offrouter-openrouter";
15
22
 
16
23
  const adapter = createOpenRouterAdapter({
17
24
  apiKey: process.env.OPENROUTER_API_KEY,
25
+ fetch: globalThis.fetch,
18
26
  });
27
+ console.log(adapter.id);
28
+ console.log((await adapter.checkAuth()).configured);
19
29
  ```
20
30
 
21
31
  Provider activation names: `OPENROUTER_API_KEY`.
22
32
 
23
- The package delegates transport and policy behavior to `offrouter-core`.
33
+ The package uses the HTTP transport from `offrouter-core`.
34
+ Apply routing policy through OffRouter before invoking a provider directly.
35
+
36
+ Expected output: `openrouter`, then `true` when credentials are present.
37
+ This checks configuration only; it does not validate credentials with the provider.
38
+
39
+ ## Features
40
+
41
+ - Named factory and `createAdapter` alias for provider `openrouter`.
42
+ - Model discovery and invocation through the shared HTTP adapter.
43
+ - Injectable fetch and base URL overrides for controlled integrations.
44
+
45
+ Live calls need injected `fetch` or `OFFROUTER_LIVE_TESTS=1`.
46
+
47
+ ## Links
48
+
49
+ - [Monorepo documentation](https://offrouter.com/docs/quickstart)
50
+ - [Provider configuration](https://offrouter.com/docs/providers)
51
+ - [npm package](https://www.npmjs.com/package/offrouter-openrouter)
52
+
53
+ ## Package scope
54
+
55
+ This is a provider library, not a standalone command.
56
+ Install `offrouter` separately for the parent CLI and policy configuration.
57
+
58
+ ## License
59
+
60
+ MIT.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offrouter-openrouter",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "build": "tsc -p tsconfig.json"
15
15
  },
16
16
  "dependencies": {
17
- "offrouter-core": "0.34.0"
17
+ "offrouter-core": "0.35.0"
18
18
  },
19
19
  "files": [
20
20
  "dist",