@kookee/sdk 0.0.1 → 0.0.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 (2) hide show
  1. package/README.md +54 -54
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @kookee/sdk
2
2
 
3
- Official SDK for Kookee - Access your blog, changelog, help center, forms, and announcements.
3
+ Official SDK for Kookee - Access your blog content via a simple API.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,7 @@ yarn add @kookee/sdk
18
18
  import { Kookee } from '@kookee/sdk';
19
19
 
20
20
  const kookee = new Kookee({
21
- projectId: 'your-project-id',
21
+ apiKey: 'your-api-key',
22
22
  });
23
23
 
24
24
  // Fetch blog posts
@@ -28,79 +28,70 @@ const posts = await kookee.blog.list({ limit: 10 });
28
28
  const post = await kookee.blog.getBySlug('hello-world');
29
29
  ```
30
30
 
31
- ## Features
32
-
33
- ### Blog
31
+ ## Blog
34
32
 
35
33
  ```typescript
36
34
  // List posts with pagination
37
- const posts = await kookee.blog.list({ limit: 10, offset: 0 });
35
+ const posts = await kookee.blog.list({ page: 1, limit: 10 });
38
36
 
39
- // Filter by tag
37
+ // Filter by tag slug
40
38
  const taggedPosts = await kookee.blog.list({ tag: 'news' });
41
39
 
42
- // Get single post
40
+ // Search posts
41
+ const searchResults = await kookee.blog.list({ search: 'tutorial' });
42
+
43
+ // Get single post by slug
43
44
  const post = await kookee.blog.getBySlug('my-post');
44
45
 
45
- // Get all tags
46
+ // Get single post by ID
47
+ const postById = await kookee.blog.getById('post-uuid');
48
+
49
+ // Get all tags with post counts
46
50
  const tags = await kookee.blog.getTags();
47
51
  ```
48
52
 
49
- ### Changelog
53
+ ## Response Types
50
54
 
51
- ```typescript
52
- // List changelog entries
53
- const entries = await kookee.changelog.list();
54
-
55
- // Filter by type
56
- const features = await kookee.changelog.list({ type: 'feature' });
57
-
58
- // Get single entry
59
- const entry = await kookee.changelog.getBySlug('v1.0.0');
60
- ```
61
-
62
- ### Help Center
55
+ ### BlogPostListItem (returned by `list()`)
63
56
 
64
57
  ```typescript
65
- // List categories
66
- const categories = await kookee.helpCenter.listCategories();
67
-
68
- // List articles
69
- const articles = await kookee.helpCenter.listArticles();
70
-
71
- // Filter by category
72
- const gettingStarted = await kookee.helpCenter.listArticles({
73
- categorySlug: 'getting-started',
74
- });
75
-
76
- // Search articles
77
- const results = await kookee.helpCenter.search('how to');
78
-
79
- // Get single article
80
- const article = await kookee.helpCenter.getArticleBySlug('installation');
58
+ interface BlogPostListItem {
59
+ id: string;
60
+ slug: string;
61
+ title: string;
62
+ excerptHtml: string | null;
63
+ coverImageUrl: string | null;
64
+ status: string;
65
+ publishedAt: string | null;
66
+ metadata: Record<string, unknown> | null;
67
+ createdAt: string;
68
+ author: { name: string };
69
+ tags: Array<{ name: string; slug: string }>;
70
+ }
81
71
  ```
82
72
 
83
- ### Forms
73
+ ### BlogPost (returned by `getBySlug()` and `getById()`)
84
74
 
85
75
  ```typescript
86
- // Get form structure
87
- const form = await kookee.forms.get('contact');
88
-
89
- // Submit form
90
- const result = await kookee.forms.submit('contact', {
91
- email: 'user@example.com',
92
- message: 'Hello!',
93
- });
76
+ interface BlogPost extends BlogPostListItem {
77
+ contentHtml: string;
78
+ metaTitle: string | null;
79
+ metaDescription: string | null;
80
+ updatedAt: string;
81
+ }
94
82
  ```
95
83
 
96
- ### Announcements
84
+ ### Paginated Response
97
85
 
98
86
  ```typescript
99
- // Get active announcements
100
- const announcements = await kookee.announcements.getActive();
101
-
102
- // Filter by type
103
- const banners = await kookee.announcements.getActive({ type: 'banner' });
87
+ interface PaginatedResponse<T> {
88
+ data: T[];
89
+ total: number;
90
+ limit: number;
91
+ offset: number;
92
+ page: number;
93
+ totalPages: number;
94
+ }
104
95
  ```
105
96
 
106
97
  ## Error Handling
@@ -118,12 +109,21 @@ try {
118
109
  }
119
110
  ```
120
111
 
112
+ ## Configuration
113
+
114
+ ```typescript
115
+ const kookee = new Kookee({
116
+ apiKey: 'your-api-key',
117
+ baseUrl: 'https://api.kookee.dev', // optional, defaults to production API
118
+ });
119
+ ```
120
+
121
121
  ## TypeScript
122
122
 
123
123
  The SDK is written in TypeScript and provides full type definitions:
124
124
 
125
125
  ```typescript
126
- import type { BlogPost, ChangelogEntry, HelpArticle } from '@kookee/sdk';
126
+ import type { BlogPost, BlogPostListItem, BlogTag, PaginatedResponse } from '@kookee/sdk';
127
127
  ```
128
128
 
129
129
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kookee/sdk",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Official Kookee SDK - Access your blog, changelog, help center, and more",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "license": "MIT",
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "https://github.com/kookee/sdk"
32
+ "url": "https://github.com/kookee-dot-dev/kookee-ts-sdk"
33
33
  },
34
34
  "homepage": "https://kookee.dev",
35
35
  "devDependencies": {