@mentio-dev/sdk 0.1.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.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @mentio-dev/sdk
2
+
3
+ Typed TypeScript client for the [Mentio API](https://docs.mentio.dev), generated from its OpenAPI document. One function per endpoint, the same names as the reference (`searchMentions`, `createKeyword`, `getAnalyticsSummary`), request and response types included. Node 22+, Bun, Deno and browsers; no runtime dependencies.
4
+
5
+ ```bash
6
+ npm install @mentio-dev/sdk
7
+ ```
8
+
9
+ ```ts
10
+ import { createMentio } from '@mentio-dev/sdk';
11
+
12
+ const mentio = createMentio({ apiKey: process.env.MENTIO_API_KEY! });
13
+
14
+ const { data, error } = await mentio.searchMentions({
15
+ query: { platform: 'reddit', relevant: 'true', limit: 25 },
16
+ });
17
+ if (error) throw new Error(error.error.message);
18
+ for (const mention of data.data) {
19
+ console.log(mention.post.platform, mention.classification?.relevance, mention.post.url);
20
+ }
21
+ ```
22
+
23
+ Every call resolves to `{ data, error, request, response }`; pass `throwOnError: true` to get `data` alone and an exception on a non-2xx. Page a list by passing `nextCursor` back as `cursor`. `mentio.client` is the underlying client for interceptors and raw requests.
24
+
25
+ The whole surface is documented at [docs.mentio.dev/sdks](https://docs.mentio.dev/sdks). Regenerate from a checkout with `pnpm --filter @mentio-dev/sdk generate`.