@oryksa/sdk 0.1.0 → 0.1.2
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.
- package/README.md +11 -4
- package/package.json +2 -2
- package/src/index.js +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Official JavaScript and TypeScript SDK for **ORYKSA AI Employees**: put an AI employee that already knows the business inside your web app, Node backend or Electron desktop app. Same brain as WhatsApp and the website chat, text and voice.
|
|
6
6
|
|
|
7
|
-
- Docs: https://
|
|
7
|
+
- Docs: https://developer.oryksa.com
|
|
8
8
|
- API: `https://api.oryksa.com/v1`
|
|
9
9
|
|
|
10
10
|
## Install
|
|
@@ -17,7 +17,7 @@ npm install @oryksa/sdk
|
|
|
17
17
|
|
|
18
18
|
```js
|
|
19
19
|
import { Oryksa } from "@oryksa/sdk";
|
|
20
|
-
const oryksa = new Oryksa(process.env.ORYKSA_API_KEY); //
|
|
20
|
+
const oryksa = new Oryksa(process.env.ORYKSA_API_KEY); // developer.oryksa.com > Keys
|
|
21
21
|
|
|
22
22
|
const r = await oryksa.chat({ message: "Are you open on Saturday?" });
|
|
23
23
|
console.log(r.reply, r.conversation_id);
|
|
@@ -61,8 +61,15 @@ app.post("/oryksa-webhook", express.raw({ type: "application/json" }), async (re
|
|
|
61
61
|
|
|
62
62
|
Every failed call throws `OryksaError` with `status`, `code` (for example `interaction_limit_reached`, `rate_limited`, `plan_required`) and `message`.
|
|
63
63
|
|
|
64
|
-
##
|
|
64
|
+
## About the author
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
**Weslley Harakawa** - Founder of ORYKSA AI and Chief Innovation Officer at Harakawa Tech. Based in Lisbon, Portugal. Specialties: artificial intelligence, web and mobile development, blockchain tokenization. Education: University of the People.
|
|
67
|
+
|
|
68
|
+
- Website: https://harakawa.tech
|
|
69
|
+
- LinkedIn: https://www.linkedin.com/in/weslleyharakawa/
|
|
70
|
+
- Instagram: https://www.instagram.com/weslley.harakawa
|
|
71
|
+
- ORYKSA AI Employees: https://oryksa.com (X: https://x.com/oryksa, Instagram: https://www.instagram.com/oryksaai, YouTube: https://www.youtube.com/@ORYKSAAI)
|
|
72
|
+
|
|
73
|
+
---
|
|
67
74
|
|
|
68
75
|
MIT License · ORYKSA AI Employees · W8 Atlantic Unipessoal Lda
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oryksa/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "ORYKSA AI Employees SDK: chat API, knowledge (Brain), webhooks and an in-app chat for web, Node and Electron.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"sideEffects": false,
|
|
13
13
|
"scripts": { "test": "node test/live.test.js" },
|
|
14
14
|
"keywords": ["oryksa", "ai", "chatbot", "customer-support", "ai-agent", "whatsapp", "mcp", "sdk"],
|
|
15
|
-
"homepage": "https://
|
|
15
|
+
"homepage": "https://developer.oryksa.com",
|
|
16
16
|
"repository": { "type": "git", "url": "https://github.com/oryksa/oryksa-js" },
|
|
17
17
|
"author": "Weslley Harakawa (https://github.com/WeslleyHarakawa)",
|
|
18
18
|
"license": "MIT"
|
package/src/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @oryksa/sdk - ORYKSA AI Employees SDK for JavaScript and TypeScript.
|
|
3
3
|
* Server client (secret API key), webhook verification, and an in-app chat
|
|
4
4
|
* client that only uses short-lived session tokens (never the secret key).
|
|
5
|
-
* Docs: https://
|
|
5
|
+
* Docs: https://developer.oryksa.com License: MIT
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const DEFAULT_BASE = "https://api.oryksa.com/v1";
|
|
9
|
-
export const VERSION = "0.1.
|
|
9
|
+
export const VERSION = "0.1.2";
|
|
10
10
|
|
|
11
11
|
export class OryksaError extends Error {
|
|
12
12
|
constructor(status, code, message, extra = {}) {
|
|
@@ -54,7 +54,7 @@ async function request(base, token, method, path, body, fetchImpl, timeoutMs) {
|
|
|
54
54
|
export class Oryksa {
|
|
55
55
|
constructor(apiKey, opts = {}) {
|
|
56
56
|
if (!apiKey || !String(apiKey).startsWith("oryk_live_")) {
|
|
57
|
-
throw new Error("An ORYKSA API key (oryk_live_...) is required. Create one
|
|
57
|
+
throw new Error("An ORYKSA API key (oryk_live_...) is required. Create one at developer.oryksa.com.");
|
|
58
58
|
}
|
|
59
59
|
if (typeof window !== "undefined" && typeof document !== "undefined" && !opts.dangerouslyAllowBrowser) {
|
|
60
60
|
throw new Error("The secret API key must stay on the server. In apps use OryksaClient with a session token.");
|