yirlo 1.3.0 → 1.3.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.
Files changed (3) hide show
  1. package/README.md +5 -3
  2. package/package.json +1 -1
  3. package/yirlo.js +3 -2
package/README.md CHANGED
@@ -2,15 +2,17 @@
2
2
 
3
3
  Run Yirlo, the AI outbound agent for B2B companies, from code or an AI agent: projects, campaigns, budgets, the inbox and replies, hot leads, webhooks and your team.
4
4
 
5
- Get an API key at https://yirlo.com/app/api-keys. Full API docs: https://yirlo.com/api-docs
5
+ Get an API key in the Yirlo app: Connect your other apps > API > Create API key (shown once, starts yk_live_). Full API docs: https://yirlo.com/api-docs
6
+
7
+ Another address (a test server): `new Yirlo(key, { baseUrl: "https://..." })`; the default is https://yirlo.com.
6
8
 
7
9
  ## SDK
8
10
 
9
11
  ```js
10
12
  import { Yirlo } from "yirlo";
11
13
  const y = new Yirlo(process.env.YIRLO_API_KEY);
12
- const me = await y.getAccount();
13
- const { campaigns } = await y.listCampaigns({ project_id: me.projects[0].id });
14
+ const { projects } = await y.listProjects();
15
+ const { campaigns } = await y.listCampaigns({ project_id: projects[0].id });
14
16
  const hot = await y.listHotLeads();
15
17
  ```
16
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yirlo",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Yirlo SDK, MCP server and terminal dashboard: run your AI cold email outreach (projects, campaigns, inbox, hot leads, budgets) from code, an AI agent or your terminal.",
5
5
  "type": "module",
6
6
  "main": "yirlo.js",
package/yirlo.js CHANGED
@@ -1,9 +1,10 @@
1
1
  // Yirlo SDK for JavaScript (Node 18+ and browsers with fetch). https://yirlo.com/sdk/yirlo.js
2
- // Generated from https://yirlo.com/api-docs/openapi.json: every call there is a method here (docs: https://yirlo.com/api-docs).
2
+ // Generated from https://yirlo.com/api-docs/openapi.json: every call there that is not deprecated is a method here (docs: https://yirlo.com/api-docs).
3
3
  // Usage: import { Yirlo } from "yirlo"; const y = new Yirlo(process.env.YIRLO_API_KEY); console.log(await y.getAccount());
4
+ // Another address (a test server): new Yirlo(key, { baseUrl: "https://..." }). The default is https://yirlo.com.
4
5
  export class YirloError extends Error { constructor(status, body) { super((body && body.detail) || `HTTP ${status}`); this.status = status; this.body = body; } }
5
6
  export class Yirlo {
6
- constructor(apiKey, { baseUrl = "https://yirlo.com" } = {}) { if (!apiKey) throw new Error("Pass your Yirlo API key (https://yirlo.com/app/api-keys)"); this.apiKey = apiKey; this.baseUrl = baseUrl.replace(/\/$/, ""); }
7
+ constructor(apiKey, { baseUrl = "https://yirlo.com" } = {}) { if (!apiKey) throw new Error("Pass your Yirlo API key (make one in the Yirlo app: Connect your other apps > API > Create API key)"); this.apiKey = apiKey; this.baseUrl = baseUrl.replace(/\/$/, ""); }
7
8
  async request(method, path, { query, body, headers } = {}) {
8
9
  const qs = query && Object.keys(query).length ? "?" + new URLSearchParams(Object.entries(query).filter(([, v]) => v != null)) : "";
9
10
  if (!path.startsWith("/public/") && !path.startsWith("/px/")) path = "/public/api/v1" + path;