@revenexx/node 0.0.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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +136 -0
  3. package/package.json +55 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Revenexx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ > **This repository is auto-generated by the [Revenexx SDK Generator](https://github.com/revenexx/sdk-generator). Do not submit changes directly — they will be overwritten on the next generation run.**
2
+
3
+ # Revenexx API — revenexx Revenexx Node SDK
4
+
5
+ ![License](https://img.shields.io/github/license/revenexx-sdks/node.svg?style=flat-square)
6
+ ![Version](https://img.shields.io/badge/api%20version-1.0.0-blue.svg?style=flat-square)
7
+ [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
8
+ [![Twitter Account](https://img.shields.io/twitter/follow/revenexx?color=00acee&label=twitter&style=flat-square)](https://twitter.com/revenexx)
9
+
10
+ Revenexx Node.js SDK for server-side applications.
11
+
12
+ ![Revenexx API — revenexx](https://revenexx.com/images/logo.svg)
13
+
14
+ ## Installation
15
+
16
+ To install via [NPM](https://www.npmjs.com/):
17
+
18
+ ```bash
19
+ npm install @revenexx/node --save
20
+ ```
21
+
22
+
23
+ ## Getting Started
24
+
25
+ ### Init your SDK
26
+
27
+ Initialize your SDK with your Revenexx API endpoint and your credentials. Use `setTenant()` to scope your requests to a tenant, sent as the `X-Revenexx-Tenant` header on every request. The client supports two authentication methods:
28
+
29
+ - **API key** — a gateway-managed scoped key (`rvxk_…`), set via `setApiKeyAuth()`. Intended for server-side or trusted environments; never embed an API key in code shipped to the browser.
30
+ - **Bearer token** — a Zitadel-issued JWT for interactive callers, set via `setBearerAuth()`. The value is sent as the `Authorization` header verbatim, so include the `Bearer ` prefix.
31
+
32
+ ```js
33
+ const { Client } = require('@revenexx/node');
34
+
35
+ const client = new Client();
36
+
37
+ client
38
+ .setEndpoint('https://api.revenexx.com') // Your Revenexx API endpoint
39
+ .setTenant('<TENANT_SLUG>') // The tenant your requests are scoped to
40
+ .setApiKeyAuth('rvxk_...') // Your scoped API key
41
+ ;
42
+ ```
43
+
44
+ Or, with a user JWT:
45
+
46
+ ```js
47
+ client
48
+ .setEndpoint('https://api.revenexx.com')
49
+ .setTenant('<TENANT_SLUG>')
50
+ .setBearerAuth(`Bearer ${jwt}`)
51
+ ;
52
+ ```
53
+
54
+ ### Make Your First Request
55
+
56
+ Once your client is set up, instantiate any of the Revenexx services with it and send a request. All service methods accept a single params object and return a promise. Full documentation for every service method can be found in the [API References](https://revenexx.com/docs).
57
+
58
+ ```js
59
+ const { Client, Products } = require('@revenexx/node');
60
+
61
+ const products = new Products(client);
62
+
63
+ const result = await products.productsList();
64
+ ```
65
+
66
+ ### Full Example
67
+
68
+ ```js
69
+ const { Client, Products } = require('@revenexx/node');
70
+
71
+ const client = new Client();
72
+
73
+ client
74
+ .setEndpoint('https://api.revenexx.com')
75
+ .setTenant('<TENANT_SLUG>')
76
+ .setApiKeyAuth('rvxk_...')
77
+ ;
78
+
79
+ const products = new Products(client);
80
+
81
+ const result = await products.productsList();
82
+
83
+ const product = await products.productsGet({ id: '<PRODUCT_ID>' });
84
+ console.log(product);
85
+ ```
86
+
87
+ ### Type Safety with Models
88
+
89
+ The SDK ships with full TypeScript definitions. Response types live in the `Models` namespace, and every service method is typed against them — including nullable fields, which are typed as `| null`.
90
+
91
+ ```typescript
92
+ import { Client, Customers, type Models } from "@revenexx/node";
93
+
94
+ const customers = new Customers(client);
95
+
96
+ const address: Models.Address = await customers.customersAddressesGet({
97
+ id: '<ADDRESS_ID>',
98
+ });
99
+
100
+ console.log(address.street, address.city);
101
+ console.log(address.company); // string | null
102
+ ```
103
+
104
+ ### Error Handling
105
+
106
+ The Revenexx Node SDK raises a `RevenexxAPIRevenexxException` object with `message`, `code` and `response` properties. You can handle any errors by catching the exception and present the `message` to the user or handle it yourself based on the provided error information.
107
+
108
+ ```javascript
109
+ const { RevenexxAPIRevenexxException, Products } = require('@revenexx/node');
110
+
111
+ const products = new Products(client);
112
+
113
+ try {
114
+ const product = await products.productsGet({ id: '<PRODUCT_ID>' });
115
+ console.log(product);
116
+ } catch (error) {
117
+ if (error instanceof RevenexxAPIRevenexxException) {
118
+ console.error(error.code, error.message);
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### Learn more
124
+
125
+ You can use the following resources to learn more and get help
126
+
127
+ - 📜 [Revenexx Docs](https://revenexx.com/docs)
128
+ - 💬 [Discord Community](https://revenexx.com/discord)
129
+
130
+ ## Contribution
131
+
132
+ This library is auto-generated by the Revenexx custom [SDK Generator](https://github.com/revenexx/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/revenexx/sdk-generator/blob/main/CONTRIBUTING.md) before sending a pull-request.
133
+
134
+ ## License
135
+
136
+ Please see the [ license]() file for more information.
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@revenexx/node",
3
+ "homepage": "https://revenexx.com",
4
+ "description": "Revenexx Node.js SDK.",
5
+ "version": "0.0.1",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "type": "commonjs",
9
+ "scripts": {
10
+ "build": "tsup"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "import": {
15
+ "types": "./dist/index.d.mts",
16
+ "default": "./dist/index.mjs"
17
+ },
18
+ "require": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/index.js"
21
+ }
22
+ },
23
+ "./file": {
24
+ "import": {
25
+ "types": "./dist/inputFile.d.mts",
26
+ "default": "./dist/inputFile.mjs"
27
+ },
28
+ "require": {
29
+ "types": "./dist/inputFile.d.ts",
30
+ "default": "./dist/inputFile.js"
31
+ }
32
+ }
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "module": "dist/index.mjs",
38
+ "types": "dist/index.d.ts",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/revenexx-sdks/node"
42
+ },
43
+ "devDependencies": {
44
+ "@types/json-bigint": "1.0.4",
45
+ "@types/node": "20.11.25",
46
+ "tsup": "7.2.0",
47
+ "esbuild-plugin-file-path-extensions": "^2.0.0",
48
+ "tslib": "2.6.2",
49
+ "typescript": "5.4.2"
50
+ },
51
+ "dependencies": {
52
+ "json-bigint": "1.0.0",
53
+ "node-fetch-native-with-agent": "1.7.2"
54
+ }
55
+ }